Skip to content

Commit dde0daf

Browse files
author
xia ning
authored
Merge pull request #218 from oOJohn6Oo/master
[BGF] remove unused reference.
2 parents 8c27c78 + edc756c commit dde0daf

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

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
@@ -419,26 +419,26 @@ public void onJoinChannelSuccess(String channel, int uid, int elapsed) {
419419
public void onRemoteVideoStateChanged(int uid, int state, int reason, int elapsed) {
420420
super.onRemoteVideoStateChanged(uid, state, reason, elapsed);
421421
Log.i(TAG, "onRemoteVideoStateChanged:uid->" + uid + ", state->" + state);
422-
if (state == REMOTE_VIDEO_STATE_STARTING) {
423-
/**Check if the context is correct*/
424-
Context context = getContext();
425-
if (context == null) {
426-
return;
427-
}
428-
handler.post(() ->
429-
{
430-
/**Display remote video stream*/
431-
SurfaceView surfaceView = RtcEngine.CreateRendererView(context);
432-
surfaceView.setZOrderMediaOverlay(true);
433-
if (fl_remote.getChildCount() > 0) {
434-
fl_remote.removeAllViews();
435-
}
436-
fl_remote.addView(surfaceView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
437-
ViewGroup.LayoutParams.MATCH_PARENT));
438-
/**Setup remote video to render*/
439-
ENGINE.setupRemoteVideo(new VideoCanvas(surfaceView, RENDER_MODE_HIDDEN, uid));
440-
});
441-
}
422+
// if (state == REMOTE_VIDEO_STATE_STARTING) {
423+
// /**Check if the context is correct*/
424+
// Context context = getContext();
425+
// if (context == null) {
426+
// return;
427+
// }
428+
// handler.post(() ->
429+
// {
430+
// /**Display remote video stream*/
431+
// SurfaceView surfaceView = RtcEngine.CreateRendererView(context);
432+
// surfaceView.setZOrderMediaOverlay(true);
433+
// if (fl_remote.getChildCount() > 0) {
434+
// fl_remote.removeAllViews();
435+
// }
436+
// fl_remote.addView(surfaceView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
437+
// ViewGroup.LayoutParams.MATCH_PARENT));
438+
// /**Setup remote video to render*/
439+
// ENGINE.setupRemoteVideo(new VideoCanvas(surfaceView, RENDER_MODE_HIDDEN, uid));
440+
// });
441+
// }
442442
}
443443

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

0 commit comments

Comments
 (0)