Browse Source

fix: tighten Media openLive opening lock around close and rejoin

main
xiaosi 2 weeks ago
parent
commit
8237204293
  1. 5
      src/views/MediaView/MediaView.vue

5
src/views/MediaView/MediaView.vue

@ -305,9 +305,10 @@ async function openLive(stream) {
return
}
opening = true
try {
await closeActiveLive()
if (disposed) return
opening = true
const seq = ++openSeq
try {
const result = await joinLiveWithRetry(stream.dockId, {}, {
@ -351,11 +352,13 @@ async function openLive(stream) {
} catch (e) {
if (seq !== openSeq || disposed || e?.code === 'ABORTED') return
if (isLeaseInvalidError(e)) {
opening = false // unlock before nested openLive via rejoin
await rejoinAfterLeaseInvalid(stream.id, stream.dockId)
return
}
await closeActiveLive()
ui.toast(e.message || '打开直播失败')
}
} finally {
opening = false
}

Loading…
Cancel
Save