Skip to content

Commit 189cc46

Browse files
oOJohn6Ooxianing
authored andcommitted
[BGF] remove unused reference.
(cherry picked from commit 1a3272a)
1 parent 21bc110 commit 189cc46

1 file changed

Lines changed: 31 additions & 31 deletions

File tree

Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/SwitchExternalVideo.java

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -422,26 +422,26 @@ public void onJoinChannelSuccess(String channel, int uid, int elapsed) {
422422
public void onRemoteVideoStateChanged(int uid, int state, int reason, int elapsed) {
423423
super.onRemoteVideoStateChanged(uid, state, reason, elapsed);
424424
Log.i(TAG, "onRemoteVideoStateChanged:uid->" + uid + ", state->" + state);
425-
if (state == REMOTE_VIDEO_STATE_STARTING) {
426-
/**Check if the context is correct*/
427-
Context context = getContext();
428-
if (context == null) {
429-
return;
430-
}
431-
handler.post(() ->
432-
{
433-
/**Display remote video stream*/
434-
SurfaceView surfaceView = RtcEngine.CreateRendererView(context);
435-
surfaceView.setZOrderMediaOverlay(true);
436-
if (fl_remote.getChildCount() > 0) {
437-
fl_remote.removeAllViews();
438-
}
439-
fl_remote.addView(surfaceView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
440-
ViewGroup.LayoutParams.MATCH_PARENT));
441-
/**Setup remote video to render*/
442-
ENGINE.setupRemoteVideo(new VideoCanvas(surfaceView, RENDER_MODE_HIDDEN, uid));
443-
});
444-
}
425+
// if (state == REMOTE_VIDEO_STATE_STARTING) {
426+
// /**Check if the context is correct*/
427+
// Context context = getContext();
428+
// if (context == null) {
429+
// return;
430+
// }
431+
// handler.post(() ->
432+
// {
433+
// /**Display remote video stream*/
434+
// SurfaceView surfaceView = RtcEngine.CreateRendererView(context);
435+
// surfaceView.setZOrderMediaOverlay(true);
436+
// if (fl_remote.getChildCount() > 0) {
437+
// fl_remote.removeAllViews();
438+
// }
439+
// fl_remote.addView(surfaceView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
440+
// ViewGroup.LayoutParams.MATCH_PARENT));
441+
// /**Setup remote video to render*/
442+
// ENGINE.setupRemoteVideo(new VideoCanvas(surfaceView, RENDER_MODE_HIDDEN, uid));
443+
// });
444+
// }
445445
}
446446

447447
/**Occurs when a remote user (Communication)/host (Live Broadcast) joins the channel.
@@ -468,17 +468,17 @@ public void onUserJoined(int uid, int elapsed) {
468468
@Override
469469
public void onUserOffline(int uid, int reason) {
470470
Log.i(TAG, String.format("user %d offline! reason:%d", uid, reason));
471-
showLongToast(String.format("user %d offline! reason:%d", uid, reason));
472-
handler.post(new Runnable() {
473-
@Override
474-
public void run() {
475-
/**Clear render view
476-
Note: The video will stay at its last frame, to completely remove it you will need to
477-
remove the SurfaceView from its parent*/
478-
ENGINE.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid));
479-
fl_remote.removeAllViews();
480-
}
481-
});
471+
// showLongToast(String.format("user %d offline! reason:%d", uid, reason));
472+
// handler.post(new Runnable() {
473+
// @Override
474+
// public void run() {
475+
// /**Clear render view
476+
// Note: The video will stay at its last frame, to completely remove it you will need to
477+
// remove the SurfaceView from its parent*/
478+
// ENGINE.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid));
479+
// fl_remote.removeAllViews();
480+
// }
481+
// });
482482
}
483483
};
484484

0 commit comments

Comments
 (0)