@hyperframes/core 0.9.95 → 0.9.97
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.
- package/dist/audibleVideo.d.ts +10 -0
- package/dist/audibleVideo.js +37 -0
- package/dist/generated/runtime-inline.js +1 -1
- package/dist/hyperframe.runtime.iife.js +67 -67
- package/dist/index.d.ts +1 -1
- package/dist/runtime/adapters/seek-dispatch.d.ts +40 -0
- package/dist/runtime/adapters/seek-dispatch.js +164 -0
- package/dist/runtime/assetUrl.d.ts +6 -0
- package/dist/runtime/assetUrl.js +8 -0
- package/dist/runtime/audioFx.d.ts +77 -0
- package/dist/runtime/audioFx.js +277 -0
- package/dist/runtime/bridge.d.ts +6 -0
- package/dist/runtime/bridge.js +20 -0
- package/dist/runtime/decodesFirst.d.ts +4 -0
- package/dist/runtime/decodesFirst.js +14 -0
- package/dist/runtime/editing/gsapSnapshot.js +12 -3
- package/dist/runtime/editing/gsapSnapshotLimits.d.ts +5 -3
- package/dist/runtime/editing/gsapSnapshotLimits.js +5 -3
- package/dist/runtime/editing/textCaret.d.ts +14 -0
- package/dist/runtime/editing/textCaret.js +98 -0
- package/dist/runtime/editing/textEdit.d.ts +8 -0
- package/dist/runtime/editing/textEdit.js +67 -10
- package/dist/runtime/editingPort.d.ts +3 -2
- package/dist/runtime/editingPort.js +2 -1
- package/dist/runtime/media.d.ts +113 -0
- package/dist/runtime/media.js +820 -0
- package/dist/runtime/mediaLoadFailure.d.ts +8 -0
- package/dist/runtime/mediaLoadFailure.js +58 -0
- package/dist/runtime/mediaProxy.d.ts +91 -0
- package/dist/runtime/mediaProxy.js +803 -0
- package/dist/runtime/playbackHealth.d.ts +31 -0
- package/dist/runtime/playbackHealth.js +137 -0
- package/dist/runtime/preloadMedia.d.ts +16 -0
- package/dist/runtime/preloadMedia.js +266 -0
- package/dist/runtime/previewCopies.d.ts +13 -0
- package/dist/runtime/previewCopies.js +80 -0
- package/dist/runtime/proxyWait.d.ts +3 -0
- package/dist/runtime/proxyWait.js +51 -0
- package/dist/runtime/runtimeLoad.d.ts +3 -0
- package/dist/runtime/runtimeLoad.js +13 -0
- package/dist/runtime/state.d.ts +7 -0
- package/dist/runtime/state.js +3 -0
- package/dist/runtime/timedClipHide.d.ts +12 -0
- package/dist/runtime/timedClipHide.js +94 -0
- package/dist/runtime/types.d.ts +29 -18
- package/dist/runtime/webAudioTransport.d.ts +243 -0
- package/dist/runtime/webAudioTransport.js +1176 -0
- package/dist/safePath.js +20 -11
- package/dist/terminalText.d.ts +1 -0
- package/dist/terminalText.js +17 -0
- package/package.json +12 -4
package/dist/audibleVideo.d.ts
CHANGED
|
@@ -12,12 +12,22 @@ export declare function audibleVideoNeedsWebAudio(fields: {
|
|
|
12
12
|
audioGroup?: string | null;
|
|
13
13
|
masterChain?: string | null;
|
|
14
14
|
}): boolean;
|
|
15
|
+
export declare const PARENT_COPY_ATTRIBUTES: readonly ["data-playback-rate", "data-automation", "data-fx-chain", "data-audio-group", "data-volume", "data-fade-in", "data-fade-out"];
|
|
15
16
|
export interface ParentCopy {
|
|
16
17
|
kind: "audio" | "video";
|
|
17
18
|
src: string;
|
|
18
19
|
start: number;
|
|
19
20
|
duration: number;
|
|
20
21
|
mediaStart: number;
|
|
22
|
+
layer?: number;
|
|
23
|
+
loop?: boolean;
|
|
24
|
+
mastered?: boolean;
|
|
25
|
+
attrs?: Partial<Record<(typeof PARENT_COPY_ATTRIBUTES)[number], string>>;
|
|
21
26
|
}
|
|
27
|
+
export declare function parentCopyKey(copy: Pick<ParentCopy, "kind" | "src" | "start" | "mediaStart" | "layer">): string;
|
|
28
|
+
export declare function parentCopyLayers(): (elements: readonly HTMLMediaElement[]) => {
|
|
29
|
+
el: HTMLMediaElement;
|
|
30
|
+
copy: ParentCopy;
|
|
31
|
+
}[];
|
|
22
32
|
export declare function mediaFileOf(el: HTMLMediaElement): string | null;
|
|
23
33
|
export declare function parentCopyOf(el: HTMLMediaElement): ParentCopy | null;
|
package/dist/audibleVideo.js
CHANGED
|
@@ -12,6 +12,35 @@ export function audibleVideoNeedsWebAudio(fields) {
|
|
|
12
12
|
return ((fields.volume ?? 1) > 1 ||
|
|
13
13
|
Boolean(fields.fxChain || fields.automation || fields.audioGroup || fields.masterChain));
|
|
14
14
|
}
|
|
15
|
+
export const PARENT_COPY_ATTRIBUTES = [
|
|
16
|
+
"data-playback-rate",
|
|
17
|
+
"data-automation",
|
|
18
|
+
"data-fx-chain",
|
|
19
|
+
"data-audio-group",
|
|
20
|
+
"data-volume",
|
|
21
|
+
"data-fade-in",
|
|
22
|
+
"data-fade-out",
|
|
23
|
+
];
|
|
24
|
+
export function parentCopyKey(copy) {
|
|
25
|
+
return JSON.stringify([copy.kind, copy.src, copy.start, copy.mediaStart, copy.layer ?? 0]);
|
|
26
|
+
}
|
|
27
|
+
export function parentCopyLayers() {
|
|
28
|
+
const layerOf = new WeakMap();
|
|
29
|
+
const nextLayer = new Map();
|
|
30
|
+
return (elements) => elements.flatMap((el) => {
|
|
31
|
+
const copy = parentCopyOf(el);
|
|
32
|
+
if (!copy)
|
|
33
|
+
return [];
|
|
34
|
+
const shared = parentCopyKey(copy);
|
|
35
|
+
let slot = layerOf.get(el);
|
|
36
|
+
if (slot?.shared !== shared) {
|
|
37
|
+
slot = { shared, layer: nextLayer.get(shared) ?? 0 };
|
|
38
|
+
nextLayer.set(shared, slot.layer + 1);
|
|
39
|
+
layerOf.set(el, slot);
|
|
40
|
+
}
|
|
41
|
+
return [{ el, copy: slot.layer === 0 ? copy : { ...copy, layer: slot.layer } }];
|
|
42
|
+
});
|
|
43
|
+
}
|
|
15
44
|
export function mediaFileOf(el) {
|
|
16
45
|
const raw = el.getAttribute("src") || el.querySelector("source")?.getAttribute("src");
|
|
17
46
|
if (!raw)
|
|
@@ -33,11 +62,19 @@ export function parentCopyOf(el) {
|
|
|
33
62
|
if (!src)
|
|
34
63
|
return null;
|
|
35
64
|
const timing = readClipTiming(el);
|
|
65
|
+
const attrs = {};
|
|
66
|
+
for (const name of PARENT_COPY_ATTRIBUTES) {
|
|
67
|
+
const value = el.getAttribute(name);
|
|
68
|
+
if (value !== null)
|
|
69
|
+
attrs[name] = value;
|
|
70
|
+
}
|
|
36
71
|
return {
|
|
37
72
|
kind: tag === "audio" ? "audio" : "video",
|
|
38
73
|
src,
|
|
39
74
|
start: timing.start ?? 0,
|
|
40
75
|
duration: timing.duration ?? Number.POSITIVE_INFINITY,
|
|
41
76
|
mediaStart: readLinkTiming(el).mediaStart,
|
|
77
|
+
loop: el.loop,
|
|
78
|
+
attrs,
|
|
42
79
|
};
|
|
43
80
|
}
|