Added preview bar with the sponsors

This commit is contained in:
Ajay Ramachandran
2019-08-12 19:34:44 -04:00
parent 640ad58c65
commit 5feed6bfcc
4 changed files with 113 additions and 0 deletions

View File

@@ -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;