Skip to content

Commit 4510240

Browse files
ggzgliAbySwifter
authored andcommitted
【TUILiveKit】【iOS】Fixed known issues
1 parent cb6db27 commit 4510240

File tree

7 files changed

+21
-1
lines changed

7 files changed

+21
-1
lines changed

iOS/LiveStreamCore/Sources/Manager/Module/CoHostManager.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class CoHostManager {
5656
throw LiveStreamCoreError.error(code: code, message: message)
5757
} catch {
5858
assert(false, "unknown error, description:[:\(error.localizedDescription)]")
59+
throw LiveStreamCoreError.error(code: .failed, message: error.localizedDescription)
5960
}
6061
}
6162

iOS/TUILiveKit/Resources/Localized/en.lproj/TUILiveKitLocalized.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@
216216
"live.endLive.onBattle.alert.endBattle" = "End Battle";
217217

218218
// MARK: - Error Toast
219-
219+
"live.error.pushing" = "It's live, please try again later.";
220220
"live.error.success" = "Operation successful";
221221
"live.error.failed" = "Uncategorized common error";
222222
"live.error.freqLimit" = "Request frequency limited, please try again later";

iOS/TUILiveKit/Resources/Localized/zh-Hans.lproj/TUILiveKitLocalized.strings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@
216216
"live.endLive.onBattle.alert.endBattle" = "断开PK";
217217

218218
// MARK: - Error Toast
219+
"live.error.pushing" = "正在直播中,请稍后再试。";
219220
"live.error.success" = "操作成功";
220221
"live.error.failed" = "操作错误";
221222
"live.error.freqLimit" = "请求被限频,请稍后重试";

iOS/TUILiveKit/Sources/Component/FloatWindow/FloatWindow.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import LiveStreamCore
1111

1212
protocol FloatWindowDataSource {
1313
func getRoomId() -> String
14+
func getOwnerId() -> String
1415
// TODO: (gg) Need to consider the type of VoiceRoom's coreView
1516
func getCoreView() -> LiveCoreView
1617
func relayoutCoreView()
@@ -83,6 +84,11 @@ extension FloatWindow {
8384
guard let controller = controller else { return nil }
8485
return controller.getRoomId()
8586
}
87+
88+
func getRoomOwnerId() -> String? {
89+
guard let controller = controller else { return nil }
90+
return controller.getOwnerId()
91+
}
8692
}
8793

8894
// MARK: -------------- IMPL --------------

iOS/TUILiveKit/Sources/LiveStream/TUILiveRoomAnchorViewController.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ extension TUILiveRoomAnchorViewController: FloatWindowDataSource {
163163
roomId
164164
}
165165

166+
func getOwnerId() -> String {
167+
coreView.roomState.ownerInfo.userId
168+
}
169+
166170
func getCoreView() -> LiveStreamCore.LiveCoreView {
167171
coreView
168172
}

iOS/TUILiveKit/Sources/LiveStream/TUILiveRoomAudienceViewController.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ extension TUILiveRoomAudienceViewController: FloatWindowDataSource {
109109
func getRoomId() -> String {
110110
roomId
111111
}
112+
113+
func getOwnerId() -> String {
114+
coreView.roomState.ownerInfo.userId
115+
}
112116

113117
func getCoreView() -> LiveCoreView {
114118
coreView

iOS/TUILiveKit/Sources/TUILiveListViewController.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ extension TUILiveListViewController {
124124
if FloatWindow.shared.getCurrentRoomId() == liveInfo.roomInfo.roomId {
125125
FloatWindow.shared.resumeLive(atViewController: self.navigationController ?? self)
126126
return
127+
} else if let ownerId = FloatWindow.shared.getRoomOwnerId(), ownerId == TUILogin.getUserID() {
128+
view.makeToast(.pushingToReturnText)
129+
return
127130
} else {
128131
FloatWindow.shared.releaseFloatWindow()
129132
}
@@ -152,4 +155,5 @@ extension TUILiveListViewController {
152155

153156
extension String {
154157
fileprivate static let liveTitleText = localized("live.room.list.live")
158+
fileprivate static let pushingToReturnText = localized("live.error.pushing")
155159
}

0 commit comments

Comments
 (0)