From 1c3b948d5f3e20a455bedf92a969db9669b23aa4 Mon Sep 17 00:00:00 2001 From: pixeltris <6952411+pixeltris@users.noreply.github.com> Date: Tue, 22 Dec 2020 18:58:05 +0000 Subject: [PATCH] Fix channel name for dyn-video-swap --- README.md | 7 +++++-- dyn-video-swap/dyn-video-swap-ublock-origin.js | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8fc92b7..52dd797 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,15 @@ This repo aims to provide multiple solutions for blocking Twitch ads. - Stuttering and looping of segments my occur. - dyn-video-swap - Ads are replaced by a low resolution stream which is swapped with the original stream for the duration of the ad. - - Similar to `dyn`, but may have a larger jump in time (you might see tiny bits of the ad). + - Similar to `dyn`, but may have a larger jump in time. + - You might see tiny bits of the ad. + - Audio controls wont work whilst the ad is playing. - low-res - No ads. - The stream is 480p for the duration of the stream. - mute-black - - Ads are muted / blacked out for the duration of the ad (you might see tiny bits of the ad). + - Ads are muted / blacked out for the duration of the ad. + - You might see tiny bits of the ad. ## Applying a solution (uBlock Origin) diff --git a/dyn-video-swap/dyn-video-swap-ublock-origin.js b/dyn-video-swap/dyn-video-swap-ublock-origin.js index ca18002..00d2a7f 100644 --- a/dyn-video-swap/dyn-video-swap-ublock-origin.js +++ b/dyn-video-swap/dyn-video-swap-ublock-origin.js @@ -32,7 +32,7 @@ twitch-videoad.js application/javascript liveVid.style.filter = "brightness(0%)"; var createTempStream = async function() { // Create new video stream TODO: Do this with callbacks - var channelName = "nickmercs"; + var channelName = window.location.pathname.substr(1);// TODO: Better way of determining the channel name var playerType = "thunderdome"; var CLIENT_ID = "kimne78kx3ncx6brgo4mv6wki5h1ko"; var tempM3u8 = null; @@ -69,8 +69,8 @@ twitch-videoad.js application/javascript tempVideo.hls.loadSource(tempM3u8); tempVideo.hls.attachMedia(tempVideo); } - console.log(tempVideo); - console.log(tempM3u8); + //console.log(tempVideo); + //console.log(tempM3u8); } } createTempStream();