Improved zero second skipping for directly loaded videos

This commit is contained in:
Ajay Ramachandran
2020-03-30 14:07:35 -04:00
parent 7f36c7eec3
commit e62d46f2dd

View File

@@ -259,7 +259,12 @@ function resetValues() {
//reset sponsor data found check //reset sponsor data found check
sponsorDataFound = false; sponsorDataFound = false;
switchingVideos = true; if (switchingVideos === null) {
// When first loading a video, it is not switching videos
switchingVideos = false;
} else {
switchingVideos = true;
}
} }
async function videoIDChange(id) { async function videoIDChange(id) {
@@ -588,7 +593,7 @@ function sponsorsLookup(id: string, channelIDPromise?) {
UUIDs = smallUUIDs; UUIDs = smallUUIDs;
} }
if (!video.paused && !switchingVideos) { if (!switchingVideos) {
// See if there are any starting sponsors // See if there are any starting sponsors
let startingSponsor: number = -1; let startingSponsor: number = -1;
for (const time of sponsorTimes) { for (const time of sponsorTimes) {