perf(core): Safari clips open at their in-point, windows as before

This commit is contained in:
Miguel Angel Simon Sierra
2026-11-09 03:55:14 -05:00
parent 3614aca112
commit c2c2d4c933
2 changed files with 6 additions and 8 deletions
+4 -6
View File
@@ -176,7 +176,7 @@ import {
forgetPositionEdit,
installPositionEditsSeekReapply,
} from "./positionEdits";
import { isOpenedAtInPoint, stillStandsIn, unheldPoster, unproxiedSrc } from "./proxySrc";
import { stillStandsIn, unheldPoster, unproxiedSrc } from "./proxySrc";
import { applyVariableBindings, unproxiedMediaSrc } from "./applyVariableBindings";
import { createColorGradingRuntime, type RuntimeColorGradingApi } from "./colorGrading";
import { COLOR_GRADING_AUTHORED_OPACITY_ATTR } from "../colorGrading";
@@ -3475,11 +3475,9 @@ export function initSandboxRuntimeModular(): void {
rawNode,
isVisibleNow,
loadsAhead &&
// A clip opened at its in-point reads little ahead of it: every one is fetched ahead, not just the next take.
(isOpenedAtInPoint(rawNode) ||
(playerFrame
? nextTakeClips(currentTime).has(rawNode)
: upcoming || mediaStaysDue(rawNode, visibleAt, currentTime))),
(playerFrame
? nextTakeClips(currentTime).has(rawNode)
: upcoming || mediaStaysDue(rawNode, visibleAt, currentTime)),
currentTime,
loadsAhead && dueAtLoopStart(rawNode, visibleAt),
);
+2 -2
View File
@@ -1,5 +1,5 @@
import { parseStrictFiniteTimingNumber, readMediaStart } from "./playbackRate";
import { isOpenedAtInPoint, recordOpenedAtInPoint } from "./proxySrc";
import { recordOpenedAtInPoint } from "./proxySrc";
import { createRuntimeStartTimeResolver } from "./startResolver";
import { readMediaRenderId } from "./renderFrameSibling";
import { defersMedia } from "./timedClipHide";
@@ -128,7 +128,7 @@ export function deferMediaUntilDue(): void {
if (start == null || !lengthIsAuthored(el)) return;
const media = el as HTMLMediaElement;
openAtInPoint(media);
if (startInFilm(el) > 0 && !isOpenedAtInPoint(media)) media.preload = "none";
if (startInFilm(el) > 0) media.preload = "none";
};
win.__hfMediaDeferral = new MutationObserver((records) => {
const startInFilm = createRuntimeStartTimeResolver({}).resolveMediaStartForElement;