From 302435c068b5be8857cca58335265892bc5c3d07 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Thu, 3 Nov 2022 10:39:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BC=80=E6=92=AD=E6=97=B6?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E7=9A=84=E7=A9=BA=E6=8C=87=E9=92=88=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/live/views/LivePushRyViewHolder.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java index febf728ae..f96e82ad5 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java @@ -1,5 +1,6 @@ package com.yunbao.live.views; +import android.app.Activity; import android.app.Dialog; import android.content.Context; import android.content.res.Resources; @@ -527,6 +528,11 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX //加入房间成功后可以通过 RCRTCLocalUser 对象发布本地默认音视频流,包括:麦克风采集的音频和摄像头采集的视频。 RCRTCEngine.getInstance().getDefaultVideoStream().setEncoderMirror(true); + if(rtcRoom==null||rtcRoom.getLocalUser()==null){ + ToastUtil.show("开播失败 room为空"); + ((LiveRyAnchorActivity) mContext).endLives(); + return; + } rtcRoom.getLocalUser().publishDefaultLiveStreams(new IRCRTCResultDataCallback() { @Override public void onSuccess(RCRTCLiveInfo rcrtcLiveInfo1) {