add enable skip intro
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user