Remove ad click overlay from mute-black / dyn-video-swap

- Also support for play/pause state of player
This commit is contained in:
pixeltris 2020-12-22 19:42:48 +00:00
parent c491bce323
commit f5bbf0b893
2 changed files with 17 additions and 0 deletions

View File

@ -18,6 +18,13 @@ twitch-videoad.js application/javascript
break; break;
} }
} }
if (tempVideo && disabledVideo && tempVideo.paused != disabledVideo.paused) {
if (disabledVideo.paused) {
tempVideo.pause();
} else {
tempVideo.play();
}
}
if (foundAd && typeof Hls !== 'undefined') { if (foundAd && typeof Hls !== 'undefined') {
//if found ad and video is visible, black out video and mute //if found ad and video is visible, black out video and mute
if (!disabledVideo) { if (!disabledVideo) {
@ -30,6 +37,11 @@ twitch-videoad.js application/javascript
liveVid.volume = 0; liveVid.volume = 0;
//black out //black out
liveVid.style.filter = "brightness(0%)"; liveVid.style.filter = "brightness(0%)";
//hide ad contianers
var adContainers = document.querySelectorAll('[data-test-selector="sad-overlay"]');
for (var i = 0; i < adContainers.length; i++) {
adContainers[i].style.display = "none";
}
var createTempStream = async function() { var createTempStream = async function() {
// Create new video stream TODO: Do this with callbacks // Create new video stream TODO: Do this with callbacks
var channelName = window.location.pathname.substr(1);// TODO: Better way of determining the channel name var channelName = window.location.pathname.substr(1);// TODO: Better way of determining the channel name

View File

@ -29,6 +29,11 @@ twitch-videoad.js application/javascript
liveVid.volume = 0; liveVid.volume = 0;
//black out //black out
liveVid.style.filter = "brightness(0%)"; liveVid.style.filter = "brightness(0%)";
//hide ad contianers
var adContainers = document.querySelectorAll('[data-test-selector="sad-overlay"]');
for (var i = 0; i < adContainers.length; i++) {
adContainers[i].style.display = "none";
}
} }
} }
} else { } else {