add enable skip intro

This commit is contained in:
MLH
2024-12-27 03:07:03 +01:00
parent 361698e84b
commit 5362f15b80

View File

@@ -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) {