mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-12 22:47:18 +03:00
Fixes for safari
This commit is contained in:
@@ -352,6 +352,10 @@
|
|||||||
filter: brightness(80%);
|
filter: brightness(80%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.segmentSummary {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
.submitButton {
|
.submitButton {
|
||||||
background-color:#ec1c1c;
|
background-color:#ec1c1c;
|
||||||
-moz-border-radius:28px;
|
-moz-border-radius:28px;
|
||||||
|
|||||||
@@ -458,7 +458,7 @@ function startSponsorSchedule(includeIntersectingSegments = false, currentTime?:
|
|||||||
if (currentTime === undefined || currentTime === null) {
|
if (currentTime === undefined || currentTime === null) {
|
||||||
const virtualTime = lastKnownVideoTime.videoTime ?
|
const virtualTime = lastKnownVideoTime.videoTime ?
|
||||||
(performance.now() - lastKnownVideoTime.preciseTime) / 1000 + lastKnownVideoTime.videoTime : null;
|
(performance.now() - lastKnownVideoTime.preciseTime) / 1000 + lastKnownVideoTime.videoTime : null;
|
||||||
if (virtualTime && Math.abs(virtualTime - video.currentTime) < 0.6){
|
if (!isSafari() && virtualTime && Math.abs(virtualTime - video.currentTime) < 0.6){
|
||||||
currentTime = virtualTime;
|
currentTime = virtualTime;
|
||||||
} else {
|
} else {
|
||||||
currentTime = video.currentTime;
|
currentTime = video.currentTime;
|
||||||
@@ -539,7 +539,7 @@ function startSponsorSchedule(includeIntersectingSegments = false, currentTime?:
|
|||||||
skippingFunction();
|
skippingFunction();
|
||||||
} else {
|
} else {
|
||||||
const delayTime = timeUntilSponsor * 1000 * (1 / video.playbackRate);
|
const delayTime = timeUntilSponsor * 1000 * (1 / video.playbackRate);
|
||||||
if (delayTime < 300 && !isSafari()) {
|
if (delayTime < 300) {
|
||||||
// For Firefox, use interval instead of timeout near the end to combat imprecise video time
|
// For Firefox, use interval instead of timeout near the end to combat imprecise video time
|
||||||
const startIntervalTime = performance.now();
|
const startIntervalTime = performance.now();
|
||||||
const startVideoTime = Math.max(currentTime, video.currentTime);
|
const startVideoTime = Math.max(currentTime, video.currentTime);
|
||||||
|
|||||||
Reference in New Issue
Block a user