mirror of
https://github.com/streamwall/streamwall.git
synced 2026-04-03 20:32:08 -04:00
Wait indefinitely for media reacquire
This commit is contained in:
@@ -4,7 +4,6 @@ import { ContentDisplayOptions } from 'streamwall-shared'
|
|||||||
|
|
||||||
const SCAN_THROTTLE = 500
|
const SCAN_THROTTLE = 500
|
||||||
const INITIAL_TIMEOUT = 10 * 1000
|
const INITIAL_TIMEOUT = 10 * 1000
|
||||||
const REACQUIRE_ELEMENT_TIMEOUT = 60 * 1000
|
|
||||||
|
|
||||||
const VIDEO_OVERRIDE_STYLE = `
|
const VIDEO_OVERRIDE_STYLE = `
|
||||||
* {
|
* {
|
||||||
@@ -197,10 +196,11 @@ async function waitForVideo(
|
|||||||
}> {
|
}> {
|
||||||
lockdownMediaTags()
|
lockdownMediaTags()
|
||||||
|
|
||||||
let video: Element | null | void = await Promise.race([
|
let queryPromise: Promise<Element | void> = waitForQuery(kind)
|
||||||
waitForQuery(kind),
|
if (timeoutMs !== Infinity) {
|
||||||
sleep(timeoutMs),
|
queryPromise = Promise.race([waitForQuery(kind), sleep(timeoutMs)])
|
||||||
])
|
}
|
||||||
|
let video: Element | null | void = await queryPromise
|
||||||
if (video instanceof HTMLMediaElement) {
|
if (video instanceof HTMLMediaElement) {
|
||||||
return { video }
|
return { video }
|
||||||
}
|
}
|
||||||
@@ -317,7 +317,7 @@ async function main() {
|
|||||||
ipcRenderer.send('view-stalled')
|
ipcRenderer.send('view-stalled')
|
||||||
clearInterval(snapshotInterval)
|
clearInterval(snapshotInterval)
|
||||||
|
|
||||||
const newMedia = await acquireMedia(REACQUIRE_ELEMENT_TIMEOUT)
|
const newMedia = await acquireMedia(Infinity)
|
||||||
if (newMedia !== media) {
|
if (newMedia !== media) {
|
||||||
media.remove()
|
media.remove()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user