mirror of
https://github.com/streamwall/streamwall.git
synced 2026-01-24 14:12:48 -05:00
Work around bug waiting for Twitch playback start
This commit is contained in:
@@ -209,15 +209,16 @@ async function findVideo(kind) {
|
||||
document.body.appendChild(video)
|
||||
}
|
||||
|
||||
video.play()
|
||||
|
||||
if (!video.videoWidth) {
|
||||
// TODO: figure out why 'playing' event doesn't fire on Twitch when video offscreen
|
||||
const videoReady = new Promise((resolve) =>
|
||||
video.addEventListener('canplay', resolve, { once: true }),
|
||||
video.addEventListener('play', resolve, { once: true }),
|
||||
)
|
||||
await videoReady
|
||||
}
|
||||
|
||||
video.play()
|
||||
|
||||
const info = {
|
||||
title: document.title,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user