Browse Source

fix. android remoteUid

matrixbirds 6 years ago
parent
commit
412ea1de6b

+ 1
- 2
android/src/main/java/com/syan/agora/AgoraManager.java View File

134
         return mRtcEngine.setupLocalVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, mLocalUid));
134
         return mRtcEngine.setupLocalVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, mLocalUid));
135
     }
135
     }
136
 
136
 
137
-    public int setupRemoteVideo(ReadableMap options) {
138
-        int uid = options.getInt("uid");
137
+    public int setupRemoteVideo(final int uid) {
139
         SurfaceView surfaceView = RtcEngine.CreateRendererView(context);
138
         SurfaceView surfaceView = RtcEngine.CreateRendererView(context);
140
         mSurfaceViews.put(uid, surfaceView);
139
         mSurfaceViews.put(uid, surfaceView);
141
         return mRtcEngine.setupRemoteVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, uid));
140
         return mRtcEngine.setupRemoteVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, uid));

+ 2
- 1
android/src/main/java/com/syan/agora/AgoraViewManage.java View File

2
 
2
 
3
 import android.view.SurfaceView;
3
 import android.view.SurfaceView;
4
 
4
 
5
+import com.facebook.react.bridge.ReadableMap;
5
 import com.facebook.react.uimanager.SimpleViewManager;
6
 import com.facebook.react.uimanager.SimpleViewManager;
6
 import com.facebook.react.uimanager.ThemedReactContext;
7
 import com.facebook.react.uimanager.ThemedReactContext;
7
 import com.facebook.react.uimanager.annotations.ReactProp;
8
 import com.facebook.react.uimanager.annotations.ReactProp;
43
     }
44
     }
44
 
45
 
45
     @ReactProp(name = "remoteUid")
46
     @ReactProp(name = "remoteUid")
46
-    public void setRemoteUid(final AgoraVideoView agoraVideoView, int remoteUid) {
47
+    public void setRemoteUid(final AgoraVideoView agoraVideoView, final int remoteUid) {
47
         AgoraManager.getInstance().setupRemoteVideo(remoteUid);
48
         AgoraManager.getInstance().setupRemoteVideo(remoteUid);
48
         surfaceView = AgoraManager.getInstance().getSurfaceView(remoteUid);
49
         surfaceView = AgoraManager.getInstance().getSurfaceView(remoteUid);
49
         //surfaceView.setVisibility(View.VISIBLE);
50
         //surfaceView.setVisibility(View.VISIBLE);