fix(live): 라이브 종료 시 참여자 블랙 스크린을 방지한다
This commit is contained in:
@@ -2668,13 +2668,17 @@ extension LiveRoomViewModel: AgoraRtcEngineDelegate {
|
||||
}
|
||||
|
||||
func rtcEngine(_ engine: AgoraRtcEngineKit, didOfflineOfUid uid: UInt, reason: AgoraUserOfflineReason) {
|
||||
DispatchQueue.main.async {[unowned self] in
|
||||
if uid == UInt(self.liveRoomInfo!.creatorId) {
|
||||
DispatchQueue.main.async { [weak self] in
|
||||
guard let self else { return }
|
||||
guard let creatorId = self.liveRoomInfo?.creatorId else { return }
|
||||
|
||||
if uid == UInt(creatorId) {
|
||||
// 라이브 종료
|
||||
self.stopV2VTranslationIfJoined()
|
||||
self.deInitAgoraEngine()
|
||||
self.liveRoomInfo = nil
|
||||
self.errorMessage = "라이브가 종료되었습니다."
|
||||
self.isShowErrorPopup = true
|
||||
AppState.shared.errorMessage = "라이브가 종료되었습니다."
|
||||
AppState.shared.isShowErrorPopup = true
|
||||
AppState.shared.roomId = 0
|
||||
} else {
|
||||
// get room info
|
||||
self.getRoomInfo()
|
||||
|
||||
Reference in New Issue
Block a user