mirror of
https://github.com/streamwall/streamwall.git
synced 2025-12-06 01:45:37 -05:00
Force document visibility state (seems to help Twitch)
This commit is contained in:
@@ -135,6 +135,17 @@ const viewStateMachine = setup({
|
||||
ensureValidURL(content.url)
|
||||
const wc = view.webContents
|
||||
wc.audioMuted = true
|
||||
wc.executeJavaScript(`
|
||||
Object.defineProperty(document, 'visibilityState', {
|
||||
value: 'visible',
|
||||
writable: true
|
||||
});
|
||||
Object.defineProperty(document, 'hidden', {
|
||||
value: false,
|
||||
writable: true
|
||||
});
|
||||
document.dispatchEvent(new Event('visibilitychange'));
|
||||
`)
|
||||
|
||||
if (/\.m3u8?$/.test(content.url)) {
|
||||
loadHTML(wc, 'playHLS', { query: { src: content.url } })
|
||||
|
||||
Reference in New Issue
Block a user