mirror of
https://github.com/streamwall/streamwall.git
synced 2026-04-03 20:32:08 -04:00
Time out videos taking too long to start
This commit is contained in:
@@ -234,7 +234,10 @@ async function findVideo(kind) {
|
|||||||
const videoReady = new Promise((resolve) =>
|
const videoReady = new Promise((resolve) =>
|
||||||
video.addEventListener('playing', resolve, { once: true }),
|
video.addEventListener('playing', resolve, { once: true }),
|
||||||
)
|
)
|
||||||
await videoReady
|
await Promise.race([videoReady, sleep(10 * 1000)])
|
||||||
|
if (!video.videoWidth) {
|
||||||
|
throw new Error('timeout waiting for video to start')
|
||||||
|
}
|
||||||
console.log('video started')
|
console.log('video started')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user