Added different ui option

This commit is contained in:
NDevTK
2020-06-27 15:16:36 +01:00
committed by GitHub
parent 0ebd7f4f8d
commit 3b59389cab

View File

@@ -1622,6 +1622,25 @@ function hideSponsorTime(barTimes) {
skipDuration += time.segment[1] - time.segment[0];
}
let times = document.getElementsByClassName("ytp-time-display notranslate")[0].getElementsByTagName("span");
times[2].innerText = formatTime(video.duration - skipDuration);
let display = document.getElementsByClassName("ytp-time-display notranslate")[0];
if (display === undefined) return
if(Config.config.hideRealTime) {
return display.getElementsByTagName("span")[2].innerText = formatTime(video.duration - skipDuration);
}
const durationID = "durationAfterSkips";
let duration;
duration = document.getElementById(durationID);
// Create span if needed
if(duration === null) {
duration = document.createElement('span');
duration.id = durationID;
display.appendChild(duration);
}
duration.innerText = " ("+formatTime(video.duration - skipDuration)+")";
}