fix(live): 라이브 종료 시 참여자 블랙 스크린을 방지한다

This commit is contained in:
Yu Sung
2026-03-13 17:23:45 +09:00
parent 026f855bc5
commit 4d39a07fbd
2 changed files with 39 additions and 5 deletions

View File

@@ -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()