|
|
|
@ -205,7 +205,7 @@ class RoomController extends GetxController { |
|
|
|
final response = await _networkService.rtcApi.disconnectRtcChannel(data); |
|
|
|
if (response.data.isSuccess) { |
|
|
|
isLive = false; |
|
|
|
await RTCManager.instance.unpublish(); |
|
|
|
await RTCManager.instance.unpublish(currentRole); |
|
|
|
if (currentRole == CurrentRole.maleAudience) { |
|
|
|
final newDetail = RtcChannelDetail( |
|
|
|
channelId: rtcChannelDetail.value!.channelId, |
|
|
|
@ -276,6 +276,9 @@ class RoomController extends GetxController { |
|
|
|
|
|
|
|
Future<void> leaveChannel() async { |
|
|
|
isLive = false; |
|
|
|
if (currentRole == CurrentRole.maleAudience || currentRole == CurrentRole.femaleAudience) { |
|
|
|
await RTCManager.instance.unpublish(currentRole); |
|
|
|
} |
|
|
|
currentRole = CurrentRole.normalUser;; |
|
|
|
await RTCManager.instance.leaveChannel(); |
|
|
|
} |
|
|
|
@ -358,8 +361,8 @@ class RoomController extends GetxController { |
|
|
|
final newDetail = RtcChannelDetail( |
|
|
|
channelId: rtcChannelDetail.value!.channelId, |
|
|
|
anchorInfo: rtcChannelDetail.value!.anchorInfo, |
|
|
|
maleInfo: rtcChannelDetail.value!.maleInfo?.uid != message['uid'] ? rtcChannelDetail.value!.maleInfo : null, |
|
|
|
femaleInfo: rtcChannelDetail.value!.femaleInfo?.uid != message['uid'] ? rtcChannelDetail.value!.femaleInfo : null, |
|
|
|
maleInfo: rtcChannelDetail.value!.maleInfo, |
|
|
|
femaleInfo: null, |
|
|
|
); |
|
|
|
rtcChannelDetail.value = newDetail; |
|
|
|
} |
|
|
|
|