Browse Source

fix. android remoteUid

matrixbirds 5 years ago
parent
commit
412ea1de6b

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

@@ -134,8 +134,7 @@ public class AgoraManager {
134 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 138
         SurfaceView surfaceView = RtcEngine.CreateRendererView(context);
140 139
         mSurfaceViews.put(uid, surfaceView);
141 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,6 +2,7 @@ package com.syan.agora;
2 2
 
3 3
 import android.view.SurfaceView;
4 4
 
5
+import com.facebook.react.bridge.ReadableMap;
5 6
 import com.facebook.react.uimanager.SimpleViewManager;
6 7
 import com.facebook.react.uimanager.ThemedReactContext;
7 8
 import com.facebook.react.uimanager.annotations.ReactProp;
@@ -43,7 +44,7 @@ public class AgoraViewManage extends SimpleViewManager<AgoraVideoView> {
43 44
     }
44 45
 
45 46
     @ReactProp(name = "remoteUid")
46
-    public void setRemoteUid(final AgoraVideoView agoraVideoView, int remoteUid) {
47
+    public void setRemoteUid(final AgoraVideoView agoraVideoView, final int remoteUid) {
47 48
         AgoraManager.getInstance().setupRemoteVideo(remoteUid);
48 49
         surfaceView = AgoraManager.getInstance().getSurfaceView(remoteUid);
49 50
         //surfaceView.setVisibility(View.VISIBLE);