Merge branch 'fix/agroa' into develop

This commit is contained in:
Max
2024-01-24 18:00:07 +08:00
2 changed files with 21 additions and 3 deletions

View File

@@ -679,7 +679,11 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
.getRoomQueueMemberInfoByAccount(myUid.toString()) .getRoomQueueMemberInfoByAccount(myUid.toString())
if (roomQueueInfo?.mChatRoomMember?.isNoProhibitMic == true && roomQueueInfo.mRoomMicInfo?.isMicMute == false) { if (roomQueueInfo?.mChatRoomMember?.isNoProhibitMic == true && roomQueueInfo.mRoomMicInfo?.isMicMute == false) {
bottomView.setMicBtnEnable(true) bottomView.setMicBtnEnable(true)
if (AudioEngineManager.get().isMute) {
bottomView.setMicBtnOpen(false)
} else {
bottomView.setMicBtnOpen(true) bottomView.setMicBtnOpen(true)
}
} else if (roomQueueInfo?.mChatRoomMember != null } else if (roomQueueInfo?.mChatRoomMember != null
&& myUid.toString() == roomQueueInfo.mChatRoomMember.account && myUid.toString() == roomQueueInfo.mChatRoomMember.account
&& roomQueueInfo.mRoomMicInfo?.isMicMute == true && roomQueueInfo.mRoomMicInfo?.isMicMute == true
@@ -1000,7 +1004,15 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
(roomInfo.isLeaveMode || AvRoomDataManager.get().isSingleRoom) (roomInfo.isLeaveMode || AvRoomDataManager.get().isSingleRoom)
&& position == -1 && position == -1
) { ) {
val currentUid = AuthModel.get().currentUid.toString()
if (roomInfo.isLeaveMode && !AvRoomDataManager.get().isSingleRoom && (AvRoomDataManager.get()
.isRoomOwner(currentUid) || AvRoomDataManager.get().isRoomAdmin(currentUid)
|| SuperAdminUtil.isSuperAdmin())
) {
SingleToastUtil.showToast("请先关闭离开模式")
} else {
showUserCardDialog(roomInfo.uid.toString()) showUserCardDialog(roomInfo.uid.toString())
}
} else { } else {
val roomQueueInfo = AvRoomDataManager.get() val roomQueueInfo = AvRoomDataManager.get()
.getRoomQueueMemberInfoByMicPosition(position) .getRoomQueueMemberInfoByMicPosition(position)

View File

@@ -11,6 +11,9 @@ import com.nnbc123.library.utils.SingleToastUtil;
import io.agora.rtc2.ClientRoleOptions; import io.agora.rtc2.ClientRoleOptions;
import io.agora.rtc2.Constants; import io.agora.rtc2.Constants;
import io.agora.rtc2.IRtcEngineEventHandler; import io.agora.rtc2.IRtcEngineEventHandler;
import io.reactivex.Observable;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.android.schedulers.AndroidSchedulers;
/** /**
* @author by 梁馨 on 2020/9/14. * @author by 梁馨 on 2020/9/14.
@@ -129,7 +132,10 @@ public class EngineEventHandler extends IRtcEngineEventHandler {
super.onClientRoleChanged(oldRole, newRole, newRoleOptions); super.onClientRoleChanged(oldRole, newRole, newRoleOptions);
//角色切换 麦克风切换 //角色切换 麦克风切换
if (newRole == Constants.CLIENT_ROLE_BROADCASTER) { if (newRole == Constants.CLIENT_ROLE_BROADCASTER) {
Observable.create((ObservableOnSubscribe) emitter -> {
RtcEngineManager.get().setMute(RtcEngineManager.get().isMute); RtcEngineManager.get().setMute(RtcEngineManager.get().isMute);
emitter.onComplete();
}).subscribeOn(AndroidSchedulers.mainThread()).subscribe();
} }
} }