mirror of
https://github.com/streamwall/streamwall.git
synced 2025-12-06 01:45:37 -05:00
Add error handling to page visibility hack
Seems to sometimes be failing with "Current display surface not available for capture".
This commit is contained in:
@@ -142,14 +142,18 @@ const viewStateMachine = setup({
|
|||||||
const wc = view.webContents
|
const wc = view.webContents
|
||||||
wc.audioMuted = true
|
wc.audioMuted = true
|
||||||
|
|
||||||
// Force page visibility
|
|
||||||
wc.capturePage(undefined, { stayAwake: true })
|
|
||||||
|
|
||||||
if (/\.m3u8?$/.test(content.url)) {
|
if (/\.m3u8?$/.test(content.url)) {
|
||||||
loadHTML(wc, 'playHLS', { query: { src: content.url } })
|
loadHTML(wc, 'playHLS', { query: { src: content.url } })
|
||||||
} else {
|
} else {
|
||||||
wc.loadURL(content.url)
|
wc.loadURL(content.url)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Force page visibility
|
||||||
|
wc.capturePage(undefined, { stayAwake: true })
|
||||||
|
} catch (err) {
|
||||||
|
console.warn('Error calling capturePage:', err)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user