Update player internals #499 (fixes player muting and buffering mitigation)

This commit is contained in:
pixeltris
2026-02-24 20:52:30 +00:00
parent 5a853805c6
commit 3a1ff51d9c
4 changed files with 18 additions and 6 deletions
+4 -1
View File
@@ -2,7 +2,7 @@ twitch-videoad.js text/javascript
(function() {
if ( /(^|\.)twitch\.tv$/.test(document.location.hostname) === false ) { return; }
'use strict';
const ourTwitchAdSolutionsVersion = 20;// Used to prevent conflicts with outdated versions of the scripts
const ourTwitchAdSolutionsVersion = 21;// Used to prevent conflicts with outdated versions of the scripts
if (typeof window.twitchAdSolutionsVersion !== 'undefined' && window.twitchAdSolutionsVersion >= ourTwitchAdSolutionsVersion) {
console.log("skipping vaft as there's another script active. ourVersion:" + ourTwitchAdSolutionsVersion + " activeVersion:" + window.twitchAdSolutionsVersion);
window.twitchAdSolutionsVersion = ourTwitchAdSolutionsVersion;
@@ -798,6 +798,9 @@ twitch-videoad.js text/javascript
}
let player = findReactNode(reactRootNode, node => node.setPlayerActive && node.props && node.props.mediaPlayerInstance);
player = player && player.props && player.props.mediaPlayerInstance ? player.props.mediaPlayerInstance : null;
if (player?.playerInstance) {
player = player.playerInstance;
}
const playerState = findReactNode(reactRootNode, node => node.setSrc && node.setInitialPlaybackSettings);
return {
player: player,