diff --git a/src/android/java/com/tencent/trtc/CustomVideoView.java b/src/android/java/com/tencent/trtc/CustomVideoView.java index 807be0f..286f6e5 100644 --- a/src/android/java/com/tencent/trtc/CustomVideoView.java +++ b/src/android/java/com/tencent/trtc/CustomVideoView.java @@ -2,6 +2,7 @@ package com.tencent.trtc; import android.content.Context; import android.graphics.Color; +import android.graphics.drawable.ColorDrawable; import android.util.AttributeSet; import android.util.Log; import android.view.LayoutInflater; @@ -84,8 +85,14 @@ public class CustomVideoView extends RelativeLayout { mTRTCCloud.startLocalAudio(TRTCCloudDef.TRTC_AUDIO_QUALITY_SPEECH); mTRTCCloud.setLocalRenderParams(params); } else { - mTRTCCloud.startRemoteView(this.userInfo.getPersonid(), mainView ? TRTCCloudDef.TRTC_VIDEO_STREAM_TYPE_BIG : TRTCCloudDef.TRTC_VIDEO_STREAM_TYPE_SMALL, videoView); + mTRTCCloud.setRemoteRenderParams(this.userInfo.getPersonid(),mainView ? TRTCCloudDef.TRTC_VIDEO_STREAM_TYPE_BIG : TRTCCloudDef.TRTC_VIDEO_STREAM_TYPE_SUB,params); + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + mTRTCCloud.startRemoteView(this.userInfo.getPersonid(), mainView ? TRTCCloudDef.TRTC_VIDEO_STREAM_TYPE_BIG : TRTCCloudDef.TRTC_VIDEO_STREAM_TYPE_SMALL, videoView); } if(this.userInfo.getDisplayName() == null || this.userInfo.getDisplayName().length() == 0){ this.titleView.setText(this.userInfo.getPersonid() + (this.userInfo.isShareUser() ? "的屏幕分享": "")); @@ -103,8 +110,10 @@ public class CustomVideoView extends RelativeLayout { } } } + Log.d(TAG,"TRTC - changeUser >>>>"+(userInfo == null ? null : userInfo.getPersonid())+"|"+ ((ColorDrawable)getBackground()).getColor()); } + private boolean isChanged(UserInfo userInfo){ return (this.userInfo == null && userInfo !=null) || (this.userInfo != null && !this.userInfo.equals(userInfo));