梳理麦克风开闭逻辑2
This commit is contained in:
parent
a96c23c2aa
commit
cc268cc00d
|
|
@ -283,6 +283,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
|||
state.isSpeak.value = true;
|
||||
state.isOpenMicrophone.value = true;
|
||||
setClientRole("主播");
|
||||
debugPrint("wgs输出===:Socket-开启发言权限:主播");
|
||||
}
|
||||
}else{
|
||||
debugPrint("wgs输出===:Socket-关闭发言权限:${e?[0]}--${e?[1]}");
|
||||
|
|
@ -297,6 +298,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
|||
state.isSpeak.value = false;
|
||||
state.isOpenMicrophone.value = false;
|
||||
setClientRole("观众");
|
||||
debugPrint("wgs输出===:Socket-关闭发言权限:观众");
|
||||
}
|
||||
}
|
||||
doHttpSetMicr();
|
||||
|
|
@ -497,12 +499,12 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
|||
channelProfile: ChannelProfileType.channelProfileLiveBroadcasting,
|
||||
));
|
||||
|
||||
// 启用音频模块
|
||||
// await state.rctEngine.value?.enableAudio();
|
||||
// 设置默认音频路由为听筒
|
||||
await state.rctEngine.value?.setDefaultAudioRouteToSpeakerphone(false);
|
||||
// 打开用户音量回调
|
||||
await state.rctEngine.value?.enableAudioVolumeIndication(interval: 200, smooth: 3, reportVad: true);
|
||||
// 启用音频模块
|
||||
enableAudio();
|
||||
|
||||
joinMeetingToRtc();
|
||||
|
||||
|
|
@ -644,11 +646,6 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
|||
await state.rctEngine.value?.setEnableSpeakerphone(mode == 1 ? false : true);
|
||||
}
|
||||
|
||||
/// 启用音频模块
|
||||
Future<void> enableAudio() async {
|
||||
await state.rctEngine.value?.enableAudio();
|
||||
}
|
||||
|
||||
/// 关闭音频模块
|
||||
Future<void> disableAudio() async {
|
||||
await state.rctEngine.value?.disableAudio();
|
||||
|
|
|
|||
Loading…
Reference in New Issue