Skip to content

Commit

Permalink
[BGF] remove unused reference.
Browse files Browse the repository at this point in the history
(cherry picked from commit 1a3272a)
  • Loading branch information
oOJohn6Oo authored and xianing committed Sep 28, 2021
1 parent f74374e commit 660a8db
Showing 1 changed file with 31 additions and 31 deletions.
Expand Up @@ -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.
Expand All @@ -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();
// }
// });
}
};

Expand Down

0 comments on commit 660a8db

Please sign in to comment.