From 5362f15b803743e806cbd8bfd067787de21cb81a Mon Sep 17 00:00:00 2001 From: CodeDevMLH Date: Fri, 27 Dec 2024 03:07:03 +0100 Subject: [PATCH] add enable skip intro --- script.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/script.js b/script.js index fc5c6f2..a5ef17c 100644 --- a/script.js +++ b/script.js @@ -12,6 +12,7 @@ let setMutedHover = true; // Set to false to disable unmuting the video on hover let umuteOnHover = true; // Set to false to disable unmuting the video on hover let unmutedVolume = 20; // Set the volume level when the video is unmuted let useSponsorBlock = true; // Set to true to use SponsorBlock data to skip intro/outro segments of trailers +let skipIntro = true; // Set to true to skip the intro segment of the trailer let plotMaxLength = 550; // Maximum number of characters in the plot let trailerMaxLength = 0; // Default value 0; length measured in ms, set to 0 to disable, could be used instead of SponsorBlock let isMuted = true; // Default value true; set to false to start the video unmuted @@ -298,13 +299,13 @@ const createSlideElement = (movie, hasVideo = false) => { 'onReady': event => { if (useSponsorBlock) { fetchSponsorBlockData(videoId).then(({ intro, outro }) => { - if (intro) { + if (intro && skipIntro) { console.log(`SponsorBlock intro segment: Start - ${intro[0]}s, End - ${intro[1]}s`); if (player && typeof player.seekTo === 'function') { player.seekTo(intro[1], true); } } else { - console.log('No intro segment found/provided'); + console.log('No intro segment found/provided or intro skipping is disabled'); } if (outro) {