1
0
mirror of https://github.com/pixeltris/TwitchAdSolutions.git synced 2024-11-22 10:22:51 +01:00

Fix hang after ad detected, force pause/resume player

This commit is contained in:
EchoDev 2023-11-05 21:47:26 +01:00 committed by GitHub
parent 8268674587
commit 926f73fd88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -431,6 +431,9 @@
if (streamInfo.EncodingsM3U8Cache[playerType].Resolution != resolutionInfo.Resolution ||
streamInfo.EncodingsM3U8Cache[playerType].RequestTime < Date.now() - EncodingCacheTimeout) {
console.log(`Blocking ads (type:${playerType}, resolution:${resolutionInfo.Resolution}, frameRate:${resolutionInfo.FrameRate}, qualityOverride:${qualityOverride})`);
postMessage({
key: 'PauseResumePlayer'
});
}
streamInfo.EncodingsM3U8Cache[playerType].RequestTime = Date.now();
streamInfo.EncodingsM3U8Cache[playerType].Value = encodingsM3u8;