From 344bbcdfc8bacaa1470f6acb1e769ebda683a483 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Sun, 29 Jan 2023 16:48:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8EPC=E7=AB=AF=E8=BF=9E?= =?UTF-8?q?=E9=BA=A6=E7=94=BB=E9=9D=A2=E4=BC=9A=E6=8B=89=E5=8D=87=E6=94=BE?= =?UTF-8?q?=E5=A4=A7=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/yunbao/live/views/LivePlayRyViewHolder.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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);