Update player internals #499 (fixes player muting and buffering mitigation)
This commit is contained in:
@@ -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,
|
||||
|
||||
+5
-2
@@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @name TwitchAdSolutions (vaft)
|
||||
// @namespace https://github.com/pixeltris/TwitchAdSolutions
|
||||
// @version 33.0.0
|
||||
// @version 34.0.0
|
||||
// @description Multiple solutions for blocking Twitch ads (vaft)
|
||||
// @updateURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/vaft/vaft.user.js
|
||||
// @downloadURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/vaft/vaft.user.js
|
||||
@@ -13,7 +13,7 @@
|
||||
// ==/UserScript==
|
||||
(function() {
|
||||
'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;
|
||||
@@ -809,6 +809,9 @@
|
||||
}
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user