From 660a8db4ba28da7691c2d9fbc679f7e40a66987a Mon Sep 17 00:00:00 2001 From: LiuQiang Date: Fri, 24 Sep 2021 23:55:11 +0800 Subject: [PATCH] [BGF] remove unused reference. (cherry picked from commit 1a3272a524fb2180bf914fee4474ac79dbc338ba) --- .../advanced/SwitchExternalVideo.java | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/SwitchExternalVideo.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/SwitchExternalVideo.java index e5c76949c..9d62d9271 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/SwitchExternalVideo.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/SwitchExternalVideo.java @@ -422,26 +422,26 @@ public void onJoinChannelSuccess(String channel, int uid, int elapsed) { public void onRemoteVideoStateChanged(int uid, int state, int reason, int elapsed) { super.onRemoteVideoStateChanged(uid, state, reason, elapsed); Log.i(TAG, "onRemoteVideoStateChanged:uid->" + uid + ", state->" + state); - if (state == REMOTE_VIDEO_STATE_STARTING) { - /**Check if the context is correct*/ - Context context = getContext(); - if (context == null) { - return; - } - handler.post(() -> - { - /**Display remote video stream*/ - SurfaceView surfaceView = RtcEngine.CreateRendererView(context); - surfaceView.setZOrderMediaOverlay(true); - if (fl_remote.getChildCount() > 0) { - fl_remote.removeAllViews(); - } - fl_remote.addView(surfaceView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, - ViewGroup.LayoutParams.MATCH_PARENT)); - /**Setup remote video to render*/ - ENGINE.setupRemoteVideo(new VideoCanvas(surfaceView, RENDER_MODE_HIDDEN, uid)); - }); - } +// if (state == REMOTE_VIDEO_STATE_STARTING) { +// /**Check if the context is correct*/ +// Context context = getContext(); +// if (context == null) { +// return; +// } +// handler.post(() -> +// { +// /**Display remote video stream*/ +// SurfaceView surfaceView = RtcEngine.CreateRendererView(context); +// surfaceView.setZOrderMediaOverlay(true); +// if (fl_remote.getChildCount() > 0) { +// fl_remote.removeAllViews(); +// } +// fl_remote.addView(surfaceView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, +// ViewGroup.LayoutParams.MATCH_PARENT)); +// /**Setup remote video to render*/ +// ENGINE.setupRemoteVideo(new VideoCanvas(surfaceView, RENDER_MODE_HIDDEN, uid)); +// }); +// } } /**Occurs when a remote user (Communication)/host (Live Broadcast) joins the channel. @@ -468,17 +468,17 @@ public void onUserJoined(int uid, int elapsed) { @Override public void onUserOffline(int uid, int reason) { Log.i(TAG, String.format("user %d offline! reason:%d", uid, reason)); - showLongToast(String.format("user %d offline! reason:%d", uid, reason)); - handler.post(new Runnable() { - @Override - public void run() { - /**Clear render view - Note: The video will stay at its last frame, to completely remove it you will need to - remove the SurfaceView from its parent*/ - ENGINE.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); - fl_remote.removeAllViews(); - } - }); +// showLongToast(String.format("user %d offline! reason:%d", uid, reason)); +// handler.post(new Runnable() { +// @Override +// public void run() { +// /**Clear render view +// Note: The video will stay at its last frame, to completely remove it you will need to +// remove the SurfaceView from its parent*/ +// ENGINE.setupRemoteVideo(new VideoCanvas(null, RENDER_MODE_HIDDEN, uid)); +// fl_remote.removeAllViews(); +// } +// }); } };