Button visible on mouse move (#149)

This commit is contained in:
DualScorch 2023-03-16 05:07:20 +01:00 committed by GitHub
parent 43830fbc13
commit 34f5e042e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,11 +181,23 @@ introSkipper.injectButton = async function () {
controls.appendChild(button); controls.appendChild(button);
} }
introSkipper.osdVisible = function () {
let osd = document.querySelector("div.videoOsdBottom");
if (!osd) {
return false;
}
return !osd.classList.contains("hide");
}
/** Get the currently playing skippable segment. */ /** Get the currently playing skippable segment. */
introSkipper.getCurrentSegment = function (position) { introSkipper.getCurrentSegment = function (position) {
for (let key in introSkipper.skipSegments) { for (let key in introSkipper.skipSegments) {
const segment = introSkipper.skipSegments[key]; const segment = introSkipper.skipSegments[key];
if (position >= segment.ShowSkipPromptAt && position < segment.HideSkipPromptAt) { if ((position >= segment.ShowSkipPromptAt && position < segment.HideSkipPromptAt) || (introSkipper.osdVisible() && position >= segment.IntroStart && position < segment.IntroEnd)) {
segment["SegmentType"] = key; segment["SegmentType"] = key;
return segment; return segment;
} }