mirror of
https://github.com/streamwall/streamwall.git
synced 2025-12-06 01:45:37 -05: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) =>
|
||||
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')
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user