@hyperframes/core 0.8.33 → 0.8.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +15 -0
  2. package/dist/audioCarve.d.ts.map +1 -1
  3. package/dist/audioCarve.js +3 -2
  4. package/dist/audioCarve.js.map +1 -1
  5. package/dist/compiler/externalScripts.d.ts +8 -0
  6. package/dist/compiler/externalScripts.d.ts.map +1 -0
  7. package/dist/compiler/externalScripts.js +34 -0
  8. package/dist/compiler/externalScripts.js.map +1 -0
  9. package/dist/compiler/htmlBundler.d.ts.map +1 -1
  10. package/dist/compiler/htmlBundler.js +75 -66
  11. package/dist/compiler/htmlBundler.js.map +1 -1
  12. package/dist/compiler/index.d.ts +1 -0
  13. package/dist/compiler/index.d.ts.map +1 -1
  14. package/dist/compiler/index.js +1 -0
  15. package/dist/compiler/index.js.map +1 -1
  16. package/dist/compiler/inlineSubCompositions.d.ts +3 -2
  17. package/dist/compiler/inlineSubCompositions.d.ts.map +1 -1
  18. package/dist/compiler/inlineSubCompositions.js +6 -1
  19. package/dist/compiler/inlineSubCompositions.js.map +1 -1
  20. package/dist/generated/position-edits-render-inline.js +1 -1
  21. package/dist/generated/position-edits-render-inline.js.map +1 -1
  22. package/dist/generated/runtime-inline.js +1 -1
  23. package/dist/generated/runtime-inline.js.map +1 -1
  24. package/dist/generators/hyperframes.d.ts +6 -0
  25. package/dist/generators/hyperframes.d.ts.map +1 -1
  26. package/dist/generators/hyperframes.js +118 -69
  27. package/dist/generators/hyperframes.js.map +1 -1
  28. package/dist/generators/richTextHtml.d.ts +3 -0
  29. package/dist/generators/richTextHtml.d.ts.map +1 -0
  30. package/dist/generators/richTextHtml.js +41 -0
  31. package/dist/generators/richTextHtml.js.map +1 -0
  32. package/dist/hyperframe.runtime.iife.js +29 -29
  33. package/dist/registry/types.d.ts +18 -1
  34. package/dist/registry/types.d.ts.map +1 -1
  35. package/dist/registry/types.js.map +1 -1
  36. package/dist/runtime/applyVariableBindings.d.ts.map +1 -1
  37. package/dist/runtime/applyVariableBindings.js +2 -1
  38. package/dist/runtime/applyVariableBindings.js.map +1 -1
  39. package/dist/runtime/bridge.d.ts.map +1 -1
  40. package/dist/runtime/bridge.js +5 -3
  41. package/dist/runtime/bridge.js.map +1 -1
  42. package/dist/runtime/clipTree.d.ts.map +1 -1
  43. package/dist/runtime/clipTree.js +2 -1
  44. package/dist/runtime/clipTree.js.map +1 -1
  45. package/dist/runtime/domRealm.d.ts +66 -0
  46. package/dist/runtime/domRealm.d.ts.map +1 -0
  47. package/dist/runtime/domRealm.js +92 -0
  48. package/dist/runtime/domRealm.js.map +1 -0
  49. package/dist/runtime/mediaVolumeEnvelope.d.ts.map +1 -1
  50. package/dist/runtime/mediaVolumeEnvelope.js +22 -6
  51. package/dist/runtime/mediaVolumeEnvelope.js.map +1 -1
  52. package/dist/runtime/playbackRate.d.ts +11 -0
  53. package/dist/runtime/playbackRate.d.ts.map +1 -1
  54. package/dist/runtime/playbackRate.js +18 -1
  55. package/dist/runtime/playbackRate.js.map +1 -1
  56. package/dist/runtime/positionEdits.d.ts.map +1 -1
  57. package/dist/runtime/positionEdits.js +8 -18
  58. package/dist/runtime/positionEdits.js.map +1 -1
  59. package/dist/runtime/renderFrameSibling.d.ts.map +1 -1
  60. package/dist/runtime/renderFrameSibling.js +2 -1
  61. package/dist/runtime/renderFrameSibling.js.map +1 -1
  62. package/dist/runtime/startResolver.d.ts +1 -0
  63. package/dist/runtime/startResolver.d.ts.map +1 -1
  64. package/dist/runtime/startResolver.js +34 -10
  65. package/dist/runtime/startResolver.js.map +1 -1
  66. package/package.json +6 -6
  67. package/schemas/registry-item.json +6 -0
  68. package/dist/runtime/audioAutomationVolume.d.ts +0 -17
  69. package/dist/runtime/audioAutomationVolume.d.ts.map +0 -1
  70. package/dist/runtime/audioAutomationVolume.js +0 -49
  71. package/dist/runtime/audioAutomationVolume.js.map +0 -1
  72. package/dist/runtime/media.d.ts +0 -95
  73. package/dist/runtime/media.d.ts.map +0 -1
  74. package/dist/runtime/media.js +0 -434
  75. package/dist/runtime/media.js.map +0 -1
@@ -1,434 +0,0 @@
1
- import { swallow } from "./diagnostics.js";
2
- import { interpolateVolumeGain } from "./mediaVolumeEnvelope.js";
3
- import { elementVolumeLaneGain } from "./audioAutomationVolume.js";
4
- import { readElementPlaybackRate, readMediaStart } from "./playbackRate.js";
5
- import { clampAudioGain } from "../audioGain.js";
6
- import { isMemberGroupHidden } from "../audioGroups.js";
7
- import { findInjectedRenderFrame } from "./renderFrameSibling.js";
8
- export { readElementPlaybackRate, resolveNaturalMediaTimelineDuration } from "./playbackRate.js";
9
- export function readElementPlaybackStart(el) {
10
- return readMediaStart(el);
11
- }
12
- /**
13
- * Resolve a media element's timeline window without conflating a video's
14
- * authored display slot with the amount of source left to decode.
15
- *
16
- * An explicit video slot may outlive its source and holds the final frame.
17
- * Audio remains source-bounded because it has no visual hold state.
18
- */
19
- export function resolveRuntimeMediaClipDuration(params) {
20
- const mediaDuration = params.isVideo
21
- ? (params.explicitDuration ?? params.sourceDuration)
22
- : params.sourceDuration;
23
- const candidates = (params.isVideo
24
- ? [mediaDuration, params.hostRemaining]
25
- : [mediaDuration, params.hostRemaining, params.explicitDuration]).filter((value) => value != null && Number.isFinite(value) && value >= 0);
26
- return candidates.length > 0 ? Math.min(...candidates) : null;
27
- }
28
- export function refreshRuntimeMediaCache(params) {
29
- const mediaEls = Array.from(document.querySelectorAll("video, audio"));
30
- const timedMediaEls = params?.shouldIncludeElement
31
- ? mediaEls.filter((el) => params.shouldIncludeElement?.(el))
32
- : mediaEls.filter((el) => el.hasAttribute("data-start"));
33
- const mediaClips = [];
34
- const videoClips = [];
35
- let maxMediaEnd = 0;
36
- for (const el of timedMediaEls) {
37
- const start = params?.resolveStartSeconds
38
- ? params.resolveStartSeconds(el)
39
- : Number.parseFloat(el.dataset.start ?? "0");
40
- if (!Number.isFinite(start))
41
- continue;
42
- const mediaStart = readElementPlaybackStart(el);
43
- const playbackRate = readElementPlaybackRate(el);
44
- const loop = el.loop;
45
- const sourceDuration = Number.isFinite(el.duration) && el.duration > 0 ? el.duration : null;
46
- let duration = params?.resolveDurationSeconds?.(el) ?? Number.parseFloat(el.dataset.duration ?? "");
47
- if ((!Number.isFinite(duration) || duration < 0) && sourceDuration != null) {
48
- // Effective duration accounts for playback rate:
49
- // at 0.5x, a 10s source plays for 20s on the timeline
50
- duration = Math.max(0, (sourceDuration - mediaStart) / playbackRate);
51
- }
52
- const hasKnownDuration = Number.isFinite(duration) && duration >= 0;
53
- const end = hasKnownDuration ? start + duration : Number.POSITIVE_INFINITY;
54
- const volumeRaw = Number.parseFloat(el.dataset.volume ?? "");
55
- const clip = {
56
- el,
57
- start,
58
- mediaStart,
59
- duration: hasKnownDuration ? duration : Number.POSITIVE_INFINITY,
60
- end,
61
- volume: Number.isFinite(volumeRaw) ? volumeRaw : null,
62
- playbackRate,
63
- loop,
64
- sourceDuration,
65
- };
66
- mediaClips.push(clip);
67
- if (el.tagName === "VIDEO")
68
- videoClips.push(clip);
69
- if (Number.isFinite(end))
70
- maxMediaEnd = Math.max(maxMediaEnd, end);
71
- }
72
- return { timedMediaEls, mediaClips, videoClips, maxMediaEnd };
73
- }
74
- // Per-element timeline→media offset from the previous tick. Used to tell a
75
- // gradual drift (initial buffer catch-up, where offset grows ~16ms/tick) from
76
- // a scrub (where offset jumps in one tick). Cleared when a clip becomes
77
- // inactive so the next activation gets a hard resync on its first tick.
78
- const lastOffset = new WeakMap();
79
- // Desired source time from the previous active tick. Unlike `forceSync`, which
80
- // also covers play/pause and rate changes, a decrease here identifies an actual
81
- // backward transport seek within an audio clip.
82
- const lastRelativeTime = new WeakMap();
83
- const strictDriftSamples = new WeakMap();
84
- // Elements that had a seek past their buffered range (common with streaming
85
- // MP3 where preload="metadata" only fetches the first few seconds). After
86
- // setting preload="auto" and calling load(), we mark the element so subsequent
87
- // ticks don't restart the fetch in a loop while the browser downloads data.
88
- // Cleared when the clip leaves its active window.
89
- const seekLoadRetried = new WeakSet();
90
- // Elements whose play() is in flight. The sync runs on a 50 ms poll and with
91
- // a 1–2 s buffer that would fire 20–40 spurious play() calls per element —
92
- // noise in devtools and, worse, each `.catch(() => {})` would swallow a real
93
- // AbortError / NotAllowedError that should surface. Cleared on the `playing`
94
- // event (actual playback started) or on `pause`/`error` (state ended).
95
- const playRequested = new WeakSet();
96
- function markPlayRequested(el) {
97
- if (playRequested.has(el))
98
- return;
99
- playRequested.add(el);
100
- const clear = () => playRequested.delete(el);
101
- el.addEventListener("playing", clear, { once: true });
102
- el.addEventListener("pause", clear, { once: true });
103
- el.addEventListener("error", clear, { once: true });
104
- }
105
- // HTMLMediaElement.NETWORK_NO_SOURCE — no usable source (404 / unsupported).
106
- const MEDIA_NETWORK_NO_SOURCE = 3;
107
- // An element that errored or has no source can't play; re-issuing play() every
108
- // tick just floods rejections. Skip it until its state changes (src reload).
109
- function isUnplayable(el) {
110
- return el.error != null || el.networkState === MEDIA_NETWORK_NO_SOURCE;
111
- }
112
- const lastRuntimeAppliedVolume = new WeakMap();
113
- function clampVolume(volume) {
114
- if (!Number.isFinite(volume))
115
- return 1;
116
- return Math.max(0, Math.min(1, volume));
117
- }
118
- /**
119
- * Drop every per-source sync baseline tracked for `el` — offset drift
120
- * samples, the seek-past-buffered-range retry latch, and the last
121
- * runtime-applied volume — so the next `syncRuntimeMedia` tick treats it as
122
- * a first tick (hard resync, fresh drift baseline) instead of comparing
123
- * against state computed for a different file. Used both when a clip leaves
124
- * its active window (below) and by the runtime's proxy-swap helper
125
- * (mediaProxy.ts) right after an in-place `src` swap, which points the same
126
- * element at a different file without ever leaving its active window.
127
- */
128
- export function evictMediaSyncState(el) {
129
- lastOffset.delete(el);
130
- lastRelativeTime.delete(el);
131
- strictDriftSamples.delete(el);
132
- seekLoadRetried.delete(el);
133
- lastRuntimeAppliedVolume.delete(el);
134
- }
135
- /** Test-only seam: whether any per-source sync state is still tracked for `el`. */
136
- export function hasMediaSyncStateForTest(el) {
137
- return (lastOffset.has(el) ||
138
- lastRelativeTime.has(el) ||
139
- strictDriftSamples.has(el) ||
140
- seekLoadRetried.has(el) ||
141
- lastRuntimeAppliedVolume.has(el));
142
- }
143
- // fallow-ignore-next-line complexity
144
- export function syncRuntimeMedia(params) {
145
- const forceMuteAll = !!(params.outputMuted || params.userMuted);
146
- for (const clip of params.clips) {
147
- const { el } = clip;
148
- if (!el.isConnected)
149
- continue;
150
- let relTime = (params.timeSeconds - clip.start) * clip.playbackRate + clip.mediaStart;
151
- const isNonLoopVideo = el.tagName === "VIDEO" && !clip.loop;
152
- const isHeldVideoTail = isNonLoopVideo &&
153
- clip.sourceDuration != null &&
154
- relTime >= clip.sourceDuration &&
155
- params.timeSeconds >= clip.start &&
156
- params.timeSeconds < clip.end;
157
- if (isHeldVideoTail && clip.sourceDuration != null) {
158
- relTime = clip.sourceDuration;
159
- }
160
- const previousRelativeTime = lastRelativeTime.get(el);
161
- const audioReenteredAfterBackwardSeek = el.tagName === "AUDIO" &&
162
- (previousRelativeTime === undefined || relTime < previousRelativeTime - 0.04);
163
- const canSeekEndedMediaBackward = !clip.loop &&
164
- clip.sourceDuration != null &&
165
- relTime >= clip.mediaStart &&
166
- relTime < clip.sourceDuration &&
167
- (isNonLoopVideo || audioReenteredAfterBackwardSeek);
168
- // Ended media can re-enter playable source after a backward timeline seek
169
- // without depending on the browser having reset `ended` first. Audio needs
170
- // a fresh activation or a measured backward transport seek so ordinary EOF
171
- // and non-seek force-sync transitions cannot replay its tail. A non-loop
172
- // video additionally remains an active visual through
173
- // its authored window, with tail seeks clamped to the final frame.
174
- const isActive = params.timeSeconds >= clip.start &&
175
- params.timeSeconds < clip.end &&
176
- relTime >= 0 &&
177
- (!el.ended || clip.loop || isHeldVideoTail || canSeekEndedMediaBackward);
178
- if (isActive) {
179
- lastRelativeTime.set(el, relTime);
180
- // Loop wrapping: when media reaches end, restart from mediaStart
181
- if (clip.loop && clip.sourceDuration != null && clip.sourceDuration > 0) {
182
- const loopLength = clip.sourceDuration - clip.mediaStart;
183
- if (loopLength > 0 && relTime >= clip.sourceDuration) {
184
- relTime = clip.mediaStart + ((relTime - clip.mediaStart) % loopLength);
185
- }
186
- }
187
- const userVol = clampVolume(params.userVolume ?? 1);
188
- const fallbackAuthorVolume = clampAudioGain(clip.volume ?? 1);
189
- const previousRuntimeVolume = lastRuntimeAppliedVolume.get(el);
190
- const currentElementVolume = clampVolume(el.volume);
191
- let authorVolume;
192
- // An explicit volume lane owns the fader. It is checked before the probed
193
- // keyframes because the two would otherwise fight, and it is the one the
194
- // author drew — `lint` warns when a track carries both.
195
- // Clip-local, NOT `relTime`. A lane's `t` is "seconds from the start of
196
- // the clip" (see HfAutomationPoint), and the render honours that: the wav
197
- // is already cut with `-ss mediaStart`, so its t=0 IS the clip's start.
198
- // `relTime` is MEDIA time — it carries mediaStart, scales by playbackRate
199
- // and wraps on a loop — so feeding it here played the envelope at a
200
- // different position than it renders, or ran it off the end entirely on a
201
- // trimmed clip. The FX lanes on this same feature use clip-local elapsed;
202
- // there is one time base, and this is it.
203
- const laneGain = elementVolumeLaneGain(el, params.timeSeconds - clip.start);
204
- if (laneGain !== null) {
205
- authorVolume = clampAudioGain(laneGain);
206
- }
207
- else if (clip.volumeKeyframes && clip.volumeKeyframes.length > 0) {
208
- // Keyframes probed from the GSAP timeline — same source as the renderer.
209
- // Use the interpolated envelope value directly; no need to track GSAP changes.
210
- // Index by elapsed time on the TIMELINE since the clip began, which is what
211
- // a normalised envelope is keyed by (and what the renderer's PCM baker uses).
212
- // `relTime` is a position inside the media SOURCE — it carries `mediaStart`
213
- // and the playback rate — so it only coincides with the envelope's time base
214
- // for an untrimmed clip playing at 1x from t=0.
215
- const elapsedInClip = params.timeSeconds - clip.start;
216
- authorVolume = clampAudioGain(interpolateVolumeGain(clip.volumeKeyframes, elapsedInClip));
217
- }
218
- else if (params.isWebAudioRouted?.(el)) {
219
- authorVolume = fallbackAuthorVolume;
220
- }
221
- else if (previousRuntimeVolume === undefined) {
222
- // First tick this clip is active. The transport has already seeked GSAP
223
- // to the current time (seekTimelineAndAdapters runs before syncRuntimeMedia),
224
- // so el.volume reflects the animated value — trust it rather than falling
225
- // back to data-volume, which would clobber the GSAP-seeked position.
226
- //
227
- // Except above unity. `el.volume` is spec-bound to [0,1], so it cannot
228
- // represent an authored boost, and reading it back can only lose the
229
- // gain. Without this, a boosted clip opened at 0 dB for one tick and
230
- // then jumped once the unchanged-since-last-tick branch below took over
231
- // — audible, and invisible to any test that ticks more than once.
232
- authorVolume = fallbackAuthorVolume > 1 ? fallbackAuthorVolume : currentElementVolume;
233
- }
234
- else if (Math.abs(currentElementVolume - previousRuntimeVolume) > 0.0001) {
235
- // GSAP (or user code) changed el.volume between ticks — track it.
236
- //
237
- // Unity-capped on purpose, and it is not a hole in the ceiling: this
238
- // reads back through `el.volume`, which the spec pins to [0,1], so it
239
- // cannot observe an above-unity value however wide the clamp gets. A
240
- // clip whose volume is actually animated takes the probed-keyframes
241
- // branch above, which carries the authored gain unclamped; this branch
242
- // is the fallback for elements no probe ran on.
243
- authorVolume = currentElementVolume;
244
- }
245
- else {
246
- // Volume unchanged since last tick — use data-volume as the baseline.
247
- authorVolume = fallbackAuthorVolume;
248
- }
249
- // A data-hidden ancestor is silent in the export (audioMixer.ts drops
250
- // it), so preview matches. Folded into the per-tick volume, not
251
- // el.muted (RULES trap: el.muted is the transport's ownership flag).
252
- // Two independent ways to be silent, and the second is not an ancestor
253
- // question: membership lives on the MEMBER's `data-audio-group`, so a
254
- // muted BUS is invisible to `closest()`. The render drops such members
255
- // (`memberGroupHidden`), so without this the export was silent where the
256
- // fallback played at full level.
257
- const silencedByHidden = el.closest("[data-hidden]") !== null || isMemberGroupHidden(el.ownerDocument, el);
258
- const effectiveVolume = silencedByHidden ? 0 : clampVolume(authorVolume * userVol);
259
- el.volume = effectiveVolume;
260
- lastRuntimeAppliedVolume.set(el, effectiveVolume);
261
- params.onElementVolume?.(el, effectiveVolume, authorVolume);
262
- // Mute only when force-muted or the transport owns this element; an unclaimed
263
- // track stays audible via the HTMLMedia fallback.
264
- if (forceMuteAll || params.isWebAudioOwned?.(el))
265
- el.muted = true;
266
- // Ensure full preload for every active media element. Streaming
267
- // formats (MP3) may arrive with preload="metadata", which only
268
- // buffers the first few seconds and causes seeks to silently fail
269
- // past the buffered range. Setting this on every tick is cheap
270
- // (no-op when already "auto") and catches elements whose preload
271
- // was overridden after init.ts set it.
272
- if (el.preload !== "auto")
273
- el.preload = "auto";
274
- try {
275
- // Per-element rate × global transport rate
276
- el.playbackRate = clip.playbackRate * params.playbackRate;
277
- }
278
- catch (err) {
279
- // ignore unsupported playbackRate
280
- swallow("runtime.media.site1", err);
281
- }
282
- // Drift correction — three tiers:
283
- //
284
- // 1. Hard sync (0.5s): first tick, timeline jumps (scrub), catastrophic
285
- // drift (>3s). Unconditional seek — accepts brief rebuffer cost.
286
- // Forcing el.currentTime every frame causes audible seek hiccups
287
- // (readyState drops briefly), so we only hard-seek when necessary.
288
- //
289
- // 2. Strict sync (40ms, 2 consecutive samples): catches accumulated
290
- // drift from pause/play toggling or browser media pipeline latency.
291
- // Offset-stabilization guard (4ms/tick) prevents false corrections
292
- // during initial buffering where offset grows naturally.
293
- //
294
- // 3. Force sync (20ms): on play/pause/seek/rate transitions, correct
295
- // any drift >20ms immediately via the forceSync one-shot flag.
296
- //
297
- // The first tick a clip is active has no previous offset to compare —
298
- // treated as hard resync so sub-compositions with non-zero mediaStart
299
- // land on the right frame.
300
- const STRICT_DRIFT_THRESHOLD = 0.04;
301
- const STRICT_REQUIRED_SAMPLES = 2;
302
- const currentElTime = el.currentTime || 0;
303
- const drift = Math.abs(currentElTime - relTime);
304
- const offset = relTime - currentElTime;
305
- const prevOffset = lastOffset.get(el);
306
- lastOffset.set(el, offset);
307
- const firstTickOfClip = prevOffset === undefined;
308
- const offsetJumped = !firstTickOfClip && Math.abs(offset - prevOffset) > 0.5;
309
- const catastrophicDrift = drift > 3;
310
- // A short audio clip can leave its native element paused just before EOF.
311
- // When the timeline re-enters the clip, rewind stale forward state at the
312
- // strict threshold; do not force cold audio forward while it buffers.
313
- const staleAudioOnFirstTick = el.tagName === "AUDIO" &&
314
- firstTickOfClip &&
315
- currentElTime - relTime > STRICT_DRIFT_THRESHOLD;
316
- const hardSync = (isHeldVideoTail && drift > 0.001) ||
317
- (el.ended && canSeekEndedMediaBackward && drift > 0.001) ||
318
- staleAudioOnFirstTick ||
319
- (drift > 0.5 && (firstTickOfClip || offsetJumped || catastrophicDrift));
320
- // Playing video elements use the browser's native decoder pipeline for
321
- // timing. Seeking a playing video resets the decoder, causing a ~150ms
322
- // freeze while it re-buffers — during which the monotonic clock advances,
323
- // creating a perpetual seek→freeze→drift→seek stutter loop. Skip strict
324
- // and force sync for playing videos; only hard sync (>0.5s) warrants
325
- // the decoder-reset cost.
326
- const isPlayingVideo = el.tagName === "VIDEO" && !el.paused;
327
- // Only apply strict sync when offset has stabilized (not growing).
328
- // During initial buffering, offset grows ~16ms/tick as the timeline
329
- // advances while media stays at 0. Accumulated drift from pause/play
330
- // toggling shows up as a stable, non-zero offset (delta near 0).
331
- const offsetStabilized = prevOffset !== undefined && Math.abs(offset - prevOffset) < 0.004;
332
- let strictSync = false;
333
- if (!isPlayingVideo &&
334
- !hardSync &&
335
- !firstTickOfClip &&
336
- offsetStabilized &&
337
- drift > STRICT_DRIFT_THRESHOLD) {
338
- const samples = (strictDriftSamples.get(el) ?? 0) + 1;
339
- strictDriftSamples.set(el, samples);
340
- if (samples >= STRICT_REQUIRED_SAMPLES) {
341
- strictSync = true;
342
- strictDriftSamples.set(el, 0);
343
- }
344
- }
345
- else if (drift <= STRICT_DRIFT_THRESHOLD) {
346
- strictDriftSamples.set(el, 0);
347
- }
348
- const forceSync = !isPlayingVideo && params.forceSync && drift > 0.02;
349
- if (hardSync || strictSync || forceSync) {
350
- // Skip the per-tick seek (and the `el.load()` drift-recovery retry
351
- // below) for `<video>` elements that have a sibling
352
- // `<img id="__render_frame_<id>__">`. The sibling is created only
353
- // by the producer's frame-injection pipeline during render — its
354
- // presence means the visual is painted from the `<img>` and the
355
- // `<video>` is `visibility: hidden`. Audio is mixed by ffmpeg from
356
- // source files in `runAudioStage`, never via Chrome's in-browser
357
- // audio path. So the `<video>`'s `currentTime` has no observable
358
- // effect during render, and the per-tick set just kicks Chrome's
359
- // media pipeline for nothing. Preview is unaffected (the sibling
360
- // only exists during render).
361
- const skipForInjectedVideo = el.tagName === "VIDEO" && !!findInjectedRenderFrame(el);
362
- if (!skipForInjectedVideo) {
363
- try {
364
- el.currentTime = relTime;
365
- }
366
- catch (err) {
367
- swallow("runtime.media.site2", err);
368
- }
369
- if (Math.abs(el.currentTime - relTime) > 0.5 && !seekLoadRetried.has(el)) {
370
- seekLoadRetried.add(el);
371
- el.load();
372
- try {
373
- el.currentTime = relTime;
374
- }
375
- catch (err) {
376
- swallow("runtime.media.site3", err);
377
- }
378
- }
379
- }
380
- playRequested.delete(el);
381
- }
382
- if (isHeldVideoTail) {
383
- if (!el.paused)
384
- el.pause();
385
- }
386
- else if (params.playing && el.paused && !playRequested.has(el) && !isUnplayable(el)) {
387
- // `HTMLMediaElement.play()` is spec'd to queue playback and resolve
388
- // once enough data is buffered, so we can unconditionally call it —
389
- // no need to gate on `readyState` or defer to a `canplay` listener.
390
- //
391
- // The old `readyState < HAVE_FUTURE_DATA` branch called `el.load()`
392
- // inside the listener, which *aborts* the in-flight fetch that
393
- // `bindMediaMetadataListeners` already started at init time and
394
- // restarts from zero. On slow networks this delayed playback by
395
- // seconds. The canplay listener was also racey — the event could
396
- // fire between `load()` and `addEventListener` attachment, wedging
397
- // the element waiting for a callback that never came.
398
- markPlayRequested(el);
399
- void el.play().catch((err) => {
400
- // If play() rejects — e.g. autoplay blocked, element removed
401
- // mid-flight — drop the in-flight flag so a future sync tick can
402
- // retry rather than getting stuck waiting for `playing`/`pause`.
403
- playRequested.delete(el);
404
- // `NotAllowedError` is the autoplay-gating browser response when
405
- // the iframe has no user activation. Signal the parent exactly
406
- // once so it can promote to parent-frame audio proxies. Retries
407
- // here would be pointless — nothing the runtime does fixes it.
408
- const name = err && typeof err === "object" && "name" in err
409
- ? String(err.name ?? "")
410
- : "";
411
- if (name === "NotAllowedError")
412
- params.onAutoplayBlocked?.();
413
- });
414
- }
415
- else if (!params.playing && !el.paused) {
416
- el.pause();
417
- }
418
- continue;
419
- }
420
- // Drop drift state when the element is not playable. If native audio EOF
421
- // arrived slightly before the authored boundary, preserve only its desired
422
- // source time while the transport remains inside that boundary. Otherwise
423
- // the next poll would mistake the cleared baseline for a fresh activation
424
- // and replay the tail. A real backward seek still decreases relTime, and a
425
- // true outside-window transition clears every baseline as before.
426
- const remainsInsideAuthoredWindow = params.timeSeconds >= clip.start && params.timeSeconds < clip.end;
427
- evictMediaSyncState(el);
428
- if (remainsInsideAuthoredWindow)
429
- lastRelativeTime.set(el, relTime);
430
- if (!el.paused)
431
- el.pause();
432
- }
433
- }
434
- //# sourceMappingURL=media.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"media.js","sourceRoot":"","sources":["../../src/runtime/media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAuB,MAAM,0BAA0B,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AAEjG,MAAM,UAAU,wBAAwB,CAAC,EAAW;IAClD,OAAO,cAAc,CAAC,EAAE,CAAC,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