修复:部分用户无法上麦问题

优化:日志上报逻辑
This commit is contained in:
2023-03-17 09:50:26 +08:00
parent 8b46c57482
commit 07f8f46f1f
2 changed files with 112 additions and 44 deletions

View File

@@ -732,6 +732,19 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
Log.e("ry", "下麦成功");
// 该用户切换为观众成功,可以以观众身份进行音视频
//退出rtc播放
leaveRoom();
}
/**
* 当切换失败且不影响当前角色继续音视频时回调
* @param errorCode 失败错误码
*/
@Override
public void onFailed(RTCErrorCode errorCode) {
Log.e("ry", "下麦失败" + errorCode);
leaveRoom();
}
private void leaveRoom(){
RCRTCEngine.getInstance().leaveRoom(new IRCRTCResultCallback() {
@Override
public void onSuccess() {
@@ -761,21 +774,11 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
@Override
public void onFailed(RTCErrorCode errorCode) {
Log.e("ry", errorCode + "退出多人房间成功");
userJoinLinkMic = false;
}
});
}
/**
* 当切换失败且不影响当前角色继续音视频时回调
* @param errorCode 失败错误码
*/
@Override
public void onFailed(RTCErrorCode errorCode) {
Log.e("ry", "下麦失败" + errorCode);
}
});
}
} else if ("Debug".equals(str)) {
@@ -938,7 +941,9 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
public void run() {
RCRTCEngine.getInstance().enableSpeaker(true);
//遍历远端用户发布的资源列表
Log.i(TAG, "软件资源数量:"+data.getLiveStreams().size());
for (RCRTCInputStream stream : data.getLiveStreams()) {
Log.i(TAG, "资源流 type: "+stream.getMediaType());
if (stream.getMediaType() == RCRTCMediaType.VIDEO) {
//暂停播放
mPlayer.stop();