diff --git a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java index 802f1cd20..91d039452 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java @@ -83,6 +83,7 @@ import cn.rongcloud.rtc.base.RCRTCRoomType; import cn.rongcloud.rtc.base.RCRTCStreamType; import cn.rongcloud.rtc.base.RTCErrorCode; import cn.rongcloud.rtc.center.stream.RCRTCAudioInputStreamImpl; +import cn.rongcloud.rtc.core.RendererCommon; public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { @@ -891,7 +892,8 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { RCRTCVideoView remoteView = new RCRTCVideoView(contexts); ((RCRTCVideoInputStream) stream).setVideoView(remoteView); //todo 本demo只演示添加1个远端用户的视图 - remoteView.setScalingType(SCALE_ASPECT_FILL); + remoteView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); + remoteView.setScalingType(RendererCommon.ScalingType.SCALE_ASPECT_FIT); ry_view.addView(remoteView); Log.e("ry", stream.getMediaType() + "rcrtcOtherRoom成功 :" + data.getLiveStreams().size()); } @@ -1072,7 +1074,8 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { }); //todo 本demo只演示添加1个远端用户的视图 ry_view.removeAllViews(); - remoteView.setScalingType(SCALE_ASPECT_FILL); + remoteView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); + remoteView.setScalingType(RendererCommon.ScalingType.SCALE_ASPECT_FIT); ry_view.addView(remoteView); } userinputStreamList1.add(stream);