vaft buffering mitigation tweaks #492
And ad segment cache memory leak fix
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
twitch-videoad.js text/javascript
|
||||
(function() {
|
||||
if ( /(^|\.)twitch\.tv$/.test(document.location.hostname) === false ) { return; }
|
||||
const ourTwitchAdSolutionsVersion = 22;// Used to prevent conflicts with outdated versions of the scripts
|
||||
const ourTwitchAdSolutionsVersion = 23;// Used to prevent conflicts with outdated versions of the scripts
|
||||
if (typeof window.twitchAdSolutionsVersion !== 'undefined' && window.twitchAdSolutionsVersion >= ourTwitchAdSolutionsVersion) {
|
||||
console.log("skipping video-swap-new as there's another script active. ourVersion:" + ourTwitchAdSolutionsVersion + " activeVersion:" + window.twitchAdSolutionsVersion);
|
||||
window.twitchAdSolutionsVersion = ourTwitchAdSolutionsVersion;
|
||||
@@ -351,7 +351,7 @@ twitch-videoad.js text/javascript
|
||||
streamInfo.NumStrippedAdSegments = 0;
|
||||
}
|
||||
streamInfo.IsStrippingAdSegments = hasStrippedAdSegments;
|
||||
AdSegmentCache.forEach((key, value, map) => {
|
||||
AdSegmentCache.forEach((value, key, map) => {
|
||||
if (value < Date.now() - 120000) {
|
||||
map.delete(key);
|
||||
}
|
||||
@@ -591,6 +591,7 @@ twitch-videoad.js text/javascript
|
||||
}
|
||||
function gqlRequest(body, playerType) {
|
||||
if (!gql_device_id) {
|
||||
gql_device_id = '';
|
||||
const chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
||||
for (let i = 0; i < 32; i += 1) {
|
||||
gql_device_id += chars.charAt(Math.floor(Math.random() * chars.length));
|
||||
|
||||
Reference in New Issue
Block a user