Browse Source

fix: pass streamSessionId when fetching live play URL

Require session id in getLivePlayURL and guard Monitor refresh
so play-url requests match the backend contract.
main
xiaosi 3 weeks ago
parent
commit
26f5738d36
  1. 6
      src/api/live.js
  2. 4
      src/composables/useMonitorLive.js

6
src/api/live.js

@ -4,8 +4,10 @@ export function joinLive(dockId, payload = {}) {
return request.post(`/v1/live/${dockId}/sessions`, payload) return request.post(`/v1/live/${dockId}/sessions`, payload)
} }
export function getLivePlayURL(dockId) {
return request.get(`/v1/live/${dockId}/play-url`)
export function getLivePlayURL(dockId, sessionId) {
return request.get(`/v1/live/${dockId}/play-url`, {
params: { streamSessionId: sessionId }
})
} }
export function heartbeatLive(dockId, sessionId) { export function heartbeatLive(dockId, sessionId) {

4
src/composables/useMonitorLive.js

@ -46,8 +46,8 @@ export function useMonitorLive({ getDockId, ui, getLivePlayer }) {
} }
async function refreshPlayURL() { async function refreshPlayURL() {
if (!live.dockId) return
const play = await getLivePlayURL(live.dockId)
if (!live.dockId || !live.session?.id) return
const play = await getLivePlayURL(live.dockId, live.session.id)
live.playUrl = play.playUrl || '' live.playUrl = play.playUrl || ''
} }

Loading…
Cancel
Save