mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 20:47:11 +03:00
Added preview bar with the sponsors
This commit is contained in:
@@ -19,6 +19,10 @@ var channelURL;
|
||||
//is this channel whitelised from getting sponsors skipped
|
||||
var channelWhitelisted = false;
|
||||
|
||||
// create preview bar
|
||||
let progressBar = document.getElementsByClassName("ytp-progress-bar-container")[0] || document.getElementsByClassName("no-model cue-range-markers")[0];
|
||||
var previewBar = new PreviewBar(progressBar);
|
||||
|
||||
if(id = getYouTubeVideoID(document.URL)){ // Direct Links
|
||||
videoIDChange(id);
|
||||
}
|
||||
@@ -310,6 +314,10 @@ function sponsorsLookup(id) {
|
||||
sponsorTimes = JSON.parse(xmlhttp.responseText).sponsorTimes;
|
||||
UUIDs = JSON.parse(xmlhttp.responseText).UUIDs;
|
||||
|
||||
//update the preview bar
|
||||
//leave the type blank for now until categories are added
|
||||
previewBar.set(sponsorTimes, [], v.duration);
|
||||
|
||||
getChannelID();
|
||||
|
||||
sponsorLookupRetries = 0;
|
||||
|
||||
Reference in New Issue
Block a user