From 7c32c6a709f5355051c6405344510a66ed4205ea Mon Sep 17 00:00:00 2001 From: zher52 Date: Tue, 22 Feb 2022 23:25:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BB=B6=E8=BF=9F=E5=A4=A7=E6=B3=95=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E5=B1=8F=E5=B9=95=E5=88=86=E4=BA=AB=E9=BB=91=E5=B1=8F?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/tencent/trtc/CustomVideoView.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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));