延迟大法解决屏幕分享黑屏的问题
This commit is contained in:
parent
05f1650517
commit
7c32c6a709
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user