@omnimedia/omnitool 1.1.0-5 → 1.1.0-7
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/package.json +3 -2
- package/s/demo/demo.css +5 -0
- package/s/demo/routines/transcode-test.ts +4 -2
- package/s/demo/routines/transitions-test.ts +2 -2
- package/s/driver/driver.ts +17 -9
- package/s/driver/fns/schematic.ts +44 -21
- package/s/driver/fns/work.ts +112 -97
- package/s/index.html.ts +6 -1
- package/s/timeline/parts/basics.ts +1 -1
- package/s/timeline/parts/compositor/export.ts +77 -0
- package/s/timeline/parts/compositor/parts/html-tree.ts +37 -0
- package/s/timeline/parts/compositor/parts/schedulers.ts +85 -0
- package/s/timeline/parts/compositor/parts/tree-builder.ts +184 -0
- package/s/timeline/parts/compositor/parts/webcodecs-tree.ts +30 -0
- package/s/timeline/parts/compositor/playback.ts +81 -0
- package/s/timeline/parts/compositor/samplers/html.ts +115 -0
- package/s/timeline/parts/compositor/samplers/webcodecs.ts +60 -0
- package/s/timeline/parts/item.ts +38 -6
- package/s/timeline/parts/media.ts +21 -0
- package/s/timeline/parts/waveform.ts +1 -1
- package/s/timeline/sugar/builders.ts +102 -0
- package/s/timeline/sugar/o.ts +75 -16
- package/s/timeline/sugar/omni-test.ts +2 -2
- package/s/timeline/sugar/omni.ts +14 -11
- package/s/timeline/timeline.ts +22 -0
- package/s/timeline/types.ts +29 -0
- package/s/timeline/utils/audio-stream.ts +15 -0
- package/s/timeline/utils/matrix.ts +33 -0
- package/s/timeline/utils/video-cursor.ts +40 -0
- package/x/demo/demo.bundle.min.js +39 -37
- package/x/demo/demo.bundle.min.js.map +4 -4
- package/x/demo/demo.css +5 -0
- package/x/demo/routines/transcode-test.js +4 -2
- package/x/demo/routines/transcode-test.js.map +1 -1
- package/x/demo/routines/transitions-test.js +2 -2
- package/x/demo/routines/transitions-test.js.map +1 -1
- package/x/driver/driver.d.ts +3 -5
- package/x/driver/driver.js +16 -9
- package/x/driver/driver.js.map +1 -1
- package/x/driver/driver.worker.bundle.min.js +2537 -148
- package/x/driver/driver.worker.bundle.min.js.map +4 -4
- package/x/driver/fns/host.d.ts +9 -2
- package/x/driver/fns/schematic.d.ts +38 -20
- package/x/driver/fns/work.d.ts +11 -4
- package/x/driver/fns/work.js +105 -96
- package/x/driver/fns/work.js.map +1 -1
- package/x/features/speech/transcribe/worker.bundle.min.js +541 -541
- package/x/features/speech/transcribe/worker.bundle.min.js.map +4 -4
- package/x/index.html +13 -3
- package/x/index.html.js +6 -1
- package/x/index.html.js.map +1 -1
- package/x/timeline/parts/basics.d.ts +1 -1
- package/x/timeline/parts/compositor/export.d.ts +9 -0
- package/x/timeline/parts/compositor/export.js +64 -0
- package/x/timeline/parts/compositor/export.js.map +1 -0
- package/x/timeline/parts/compositor/parts/html-tree.d.ts +3 -0
- package/x/timeline/parts/compositor/parts/html-tree.js +40 -0
- package/x/timeline/parts/compositor/parts/html-tree.js.map +1 -0
- package/x/timeline/parts/compositor/parts/schedulers.d.ts +15 -0
- package/x/timeline/parts/compositor/parts/schedulers.js +64 -0
- package/x/timeline/parts/compositor/parts/schedulers.js.map +1 -0
- package/x/timeline/parts/compositor/parts/tree-builder.d.ts +37 -0
- package/x/timeline/parts/compositor/parts/tree-builder.js +147 -0
- package/x/timeline/parts/compositor/parts/tree-builder.js.map +1 -0
- package/x/timeline/parts/compositor/parts/webcodecs-tree.d.ts +3 -0
- package/x/timeline/parts/compositor/parts/webcodecs-tree.js +28 -0
- package/x/timeline/parts/compositor/parts/webcodecs-tree.js.map +1 -0
- package/x/timeline/parts/compositor/playback.d.ts +19 -0
- package/x/timeline/parts/compositor/playback.js +71 -0
- package/x/timeline/parts/compositor/playback.js.map +1 -0
- package/x/timeline/parts/compositor/samplers/html.d.ts +3 -0
- package/x/timeline/parts/compositor/samplers/html.js +106 -0
- package/x/timeline/parts/compositor/samplers/html.js.map +1 -0
- package/x/timeline/parts/compositor/samplers/webcodecs.d.ts +2 -0
- package/x/timeline/parts/compositor/samplers/webcodecs.js +55 -0
- package/x/timeline/parts/compositor/samplers/webcodecs.js.map +1 -0
- package/x/timeline/parts/item.d.ts +34 -8
- package/x/timeline/parts/item.js +6 -3
- package/x/timeline/parts/item.js.map +1 -1
- package/x/timeline/parts/media.d.ts +3 -0
- package/x/timeline/parts/media.js +17 -0
- package/x/timeline/parts/media.js.map +1 -1
- package/x/timeline/parts/waveform.js +1 -1
- package/x/timeline/parts/waveform.js.map +1 -1
- package/x/timeline/sugar/builders.d.ts +96 -0
- package/x/timeline/sugar/builders.js +108 -0
- package/x/timeline/sugar/builders.js.map +1 -0
- package/x/timeline/sugar/o.d.ts +21 -8
- package/x/timeline/sugar/o.js +63 -14
- package/x/timeline/sugar/o.js.map +1 -1
- package/x/timeline/sugar/omni-test.js +1 -1
- package/x/timeline/sugar/omni-test.js.map +1 -1
- package/x/timeline/sugar/omni.d.ts +7 -3
- package/x/timeline/sugar/omni.js +9 -8
- package/x/timeline/sugar/omni.js.map +1 -1
- package/x/timeline/timeline.d.ts +9 -0
- package/x/timeline/timeline.js +22 -0
- package/x/timeline/timeline.js.map +1 -0
- package/x/timeline/types.d.ts +24 -0
- package/x/timeline/types.js +2 -0
- package/x/timeline/types.js.map +1 -0
- package/x/timeline/utils/audio-stream.d.ts +6 -0
- package/x/timeline/utils/audio-stream.js +17 -0
- package/x/timeline/utils/audio-stream.js.map +1 -0
- package/x/timeline/utils/matrix.d.ts +8 -0
- package/x/timeline/utils/matrix.js +26 -0
- package/x/timeline/utils/matrix.js.map +1 -0
- package/x/timeline/utils/video-cursor.d.ts +10 -0
- package/x/timeline/utils/video-cursor.js +36 -0
- package/x/timeline/utils/video-cursor.js.map +1 -0
- package/x/tools/speech-recognition/whisper/parts/worker.bundle.min.js +6 -6
- package/x/tools/speech-recognition/whisper/parts/worker.bundle.min.js.map +4 -4
package/x/index.html
CHANGED
|
@@ -53,6 +53,11 @@ body {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
canvas {
|
|
57
|
+
width: 500px;
|
|
58
|
+
height: 300px;
|
|
59
|
+
}
|
|
60
|
+
|
|
56
61
|
#filmstrip {
|
|
57
62
|
display: flex;
|
|
58
63
|
overflow-x: scroll;
|
|
@@ -60,7 +65,7 @@ body {
|
|
|
60
65
|
}
|
|
61
66
|
|
|
62
67
|
</style>
|
|
63
|
-
<script type=module src="demo/demo.bundle.min.js?v=
|
|
68
|
+
<script type=module src="demo/demo.bundle.min.js?v=a1a457609cb3"></script>
|
|
64
69
|
|
|
65
70
|
|
|
66
71
|
<meta name="theme-color" content="#3cff9c">
|
|
@@ -80,9 +85,9 @@ body {
|
|
|
80
85
|
<body>
|
|
81
86
|
|
|
82
87
|
<section>
|
|
83
|
-
<h1>Omnitool <small>v1.1.0-
|
|
88
|
+
<h1>Omnitool <small>v1.1.0-7</small></h1>
|
|
84
89
|
<button class=fetch>fetch</button>
|
|
85
|
-
<
|
|
90
|
+
<input type="file" class="file-input">
|
|
86
91
|
<div class=results></div>
|
|
87
92
|
<div class=filmstrip-demo>
|
|
88
93
|
<label for="viewable-range">viewable range:</label>
|
|
@@ -99,6 +104,11 @@ body {
|
|
|
99
104
|
<label for="width">width:</label>
|
|
100
105
|
<input class="width" id="width" name="width" type="range" min="100" max="1000000" value="1000" />
|
|
101
106
|
</div>
|
|
107
|
+
<div class=player>
|
|
108
|
+
<input class="seek" type="number" min="0">
|
|
109
|
+
<button class=play>play</button>
|
|
110
|
+
<button class=stop>stop</button>
|
|
111
|
+
</div>
|
|
102
112
|
</section>
|
|
103
113
|
|
|
104
114
|
</body>
|
package/x/index.html.js
CHANGED
|
@@ -24,7 +24,7 @@ export default ssg.page(import.meta.url, async (orb) => ({
|
|
|
24
24
|
<section>
|
|
25
25
|
<h1>Omnitool <small>v${orb.packageVersion()}</small></h1>
|
|
26
26
|
<button class=fetch>fetch</button>
|
|
27
|
-
<
|
|
27
|
+
<input type="file" class="file-input">
|
|
28
28
|
<div class=results></div>
|
|
29
29
|
<div class=filmstrip-demo>
|
|
30
30
|
<label for="viewable-range">viewable range:</label>
|
|
@@ -41,6 +41,11 @@ export default ssg.page(import.meta.url, async (orb) => ({
|
|
|
41
41
|
<label for="width">width:</label>
|
|
42
42
|
<input class="width" id="width" name="width" type="range" min="100" max="1000000" value="1000" />
|
|
43
43
|
</div>
|
|
44
|
+
<div class=player>
|
|
45
|
+
<input class="seek" type="number" min="0">
|
|
46
|
+
<button class=play>play</button>
|
|
47
|
+
<button class=stop>stop</button>
|
|
48
|
+
</div>
|
|
44
49
|
</section>
|
|
45
50
|
`,
|
|
46
51
|
}));
|
package/x/index.html.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.html.js","sourceRoot":"","sources":["../s/index.html.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,aAAa,CAAA;AAErC,MAAM,KAAK,GAAG,UAAU,CAAA;AACxB,MAAM,MAAM,GAAG,uBAAuB,CAAA;AACtC,MAAM,OAAO,GAAG,qBAAqB,CAAA;AAErC,eAAe,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAC,GAAG,EAAC,EAAE,CAAC,CAAC;IACtD,KAAK;IACL,WAAW;IACX,IAAI,EAAE,IAAI;IACV,GAAG,EAAE,eAAe;IACpB,EAAE,EAAE,yBAAyB;IAE7B,IAAI,EAAE,IAAI,CAAA;;;;EAIT;IAED,UAAU,EAAE;QACX,KAAK;QACL,WAAW,EAAE,0BAA0B;QACvC,UAAU,EAAE,SAAS;QACrB,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,WAAW,MAAM,GAAG,OAAO,EAAE;KACpC;IAED,IAAI,EAAE,IAAI,CAAA;;0BAEe,GAAG,CAAC,cAAc,EAAE
|
|
1
|
+
{"version":3,"file":"index.html.js","sourceRoot":"","sources":["../s/index.html.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,aAAa,CAAA;AAErC,MAAM,KAAK,GAAG,UAAU,CAAA;AACxB,MAAM,MAAM,GAAG,uBAAuB,CAAA;AACtC,MAAM,OAAO,GAAG,qBAAqB,CAAA;AAErC,eAAe,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAC,GAAG,EAAC,EAAE,CAAC,CAAC;IACtD,KAAK;IACL,WAAW;IACX,IAAI,EAAE,IAAI;IACV,GAAG,EAAE,eAAe;IACpB,EAAE,EAAE,yBAAyB;IAE7B,IAAI,EAAE,IAAI,CAAA;;;;EAIT;IAED,UAAU,EAAE;QACX,KAAK;QACL,WAAW,EAAE,0BAA0B;QACvC,UAAU,EAAE,SAAS;QACrB,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,WAAW,MAAM,GAAG,OAAO,EAAE;KACpC;IAED,IAAI,EAAE,IAAI,CAAA;;0BAEe,GAAG,CAAC,cAAc,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;EAyB5C;CACD,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TimelineFile } from "../basics.js";
|
|
2
|
+
import { DecoderSource } from "../../../driver/fns/schematic.js";
|
|
3
|
+
export declare class Export {
|
|
4
|
+
#private;
|
|
5
|
+
private framerate;
|
|
6
|
+
private resolveMedia;
|
|
7
|
+
constructor(framerate?: number, resolveMedia?: (hash: string) => DecoderSource);
|
|
8
|
+
render(timeline: TimelineFile): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { context } from "../../../context.js";
|
|
2
|
+
import { fixedStep } from "./parts/schedulers.js";
|
|
3
|
+
import { makeWebCodecsSampler } from "./samplers/webcodecs.js";
|
|
4
|
+
import { buildWebCodecsNodeTree } from "./parts/webcodecs-tree.js";
|
|
5
|
+
export class Export {
|
|
6
|
+
framerate;
|
|
7
|
+
resolveMedia;
|
|
8
|
+
#sampler;
|
|
9
|
+
constructor(framerate = 30, resolveMedia = _hash => "/assets/temp/gl.mp4") {
|
|
10
|
+
this.framerate = framerate;
|
|
11
|
+
this.resolveMedia = resolveMedia;
|
|
12
|
+
this.#sampler = makeWebCodecsSampler(this.resolveMedia);
|
|
13
|
+
}
|
|
14
|
+
async #build(timeline) {
|
|
15
|
+
const rootItem = new Map(timeline.items.map(i => [i.id, i])).get(timeline.rootId);
|
|
16
|
+
const items = new Map(timeline.items.map(i => [i.id, i]));
|
|
17
|
+
return await buildWebCodecsNodeTree(rootItem, items, this.#sampler);
|
|
18
|
+
}
|
|
19
|
+
async render(timeline) {
|
|
20
|
+
const root = await this.#build(timeline);
|
|
21
|
+
const driver = await context.driver;
|
|
22
|
+
const videoStream = new TransformStream();
|
|
23
|
+
const audioStream = new TransformStream();
|
|
24
|
+
const encodePromise = driver.encode({
|
|
25
|
+
video: videoStream.readable,
|
|
26
|
+
audio: audioStream.readable,
|
|
27
|
+
config: {
|
|
28
|
+
audio: { codec: "opus", bitrate: 128000 },
|
|
29
|
+
video: { codec: "vp9", bitrate: 1000000 },
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
const videoWriter = videoStream.writable.getWriter();
|
|
33
|
+
const audioWriter = audioStream.writable.getWriter();
|
|
34
|
+
const audioPromise = (async () => {
|
|
35
|
+
if (root.audio) {
|
|
36
|
+
for await (const chunk of root.audio.getStream()) {
|
|
37
|
+
await audioWriter.write(chunk);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
await audioWriter.close();
|
|
41
|
+
})();
|
|
42
|
+
const videoPromise = (async () => {
|
|
43
|
+
let i = 0;
|
|
44
|
+
const dt = 1 / this.framerate;
|
|
45
|
+
await fixedStep({ fps: this.framerate, duration: root.duration ?? 0 }, async (t) => {
|
|
46
|
+
const layers = await root.visuals?.sampleAt(t) ?? [];
|
|
47
|
+
const composed = await driver.composite(layers);
|
|
48
|
+
const vf = new VideoFrame(composed, {
|
|
49
|
+
timestamp: Math.round(i * dt * 1_000_000),
|
|
50
|
+
duration: Math.round(dt * 1_000_000),
|
|
51
|
+
});
|
|
52
|
+
await videoWriter.write(vf);
|
|
53
|
+
composed.close();
|
|
54
|
+
i++;
|
|
55
|
+
});
|
|
56
|
+
await videoWriter.close();
|
|
57
|
+
})();
|
|
58
|
+
await audioPromise;
|
|
59
|
+
await videoPromise;
|
|
60
|
+
await encodePromise;
|
|
61
|
+
// this.#sampler.dispose()
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../../../s/timeline/parts/compositor/export.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAA;AAC3C,OAAO,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAC,oBAAoB,EAAC,MAAM,yBAAyB,CAAA;AAE5D,OAAO,EAAC,sBAAsB,EAAC,MAAM,2BAA2B,CAAA;AAEhE,MAAM,OAAO,MAAM;IAGT;IACA;IAHT,QAAQ,CAAA;IACR,YACS,YAAY,EAAE,EACd,eAAgD,KAAK,CAAC,EAAE,CAAC,qBAAqB;QAD9E,cAAS,GAAT,SAAS,CAAK;QACd,iBAAY,GAAZ,YAAY,CAAkE;QAEtF,IAAI,CAAC,QAAQ,GAAG,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;IACxD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,QAAsB;QAClC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAE,CAAA;QAClF,MAAM,KAAK,GAAG,IAAI,GAAG,CAA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super(items, sampler);
|
|
7
|
+
this.items = items;
|
|
8
|
+
this.sampler = sampler;
|
|
9
|
+
}
|
|
10
|
+
composeAudio_Stack(children) {
|
|
11
|
+
return {
|
|
12
|
+
onTimeUpdate: (time) => {
|
|
13
|
+
for (const child of children) {
|
|
14
|
+
if (child.audio)
|
|
15
|
+
child.audio.onTimeUpdate(time);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
composeAudio_Sequence(children) {
|
|
21
|
+
return {
|
|
22
|
+
onTimeUpdate: (time) => {
|
|
23
|
+
let localTime = time;
|
|
24
|
+
for (const child of children) {
|
|
25
|
+
if (localTime < child.duration) {
|
|
26
|
+
if (child.audio)
|
|
27
|
+
child.audio.onTimeUpdate(localTime);
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
localTime -= child.duration;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export function buildHTMLNodeTree(root, items, sampler) {
|
|
37
|
+
const builder = new HTMLNodeBuilder(items, sampler);
|
|
38
|
+
return builder.build(root);
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=html-tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-tree.js","sourceRoot":"","sources":["../../../../../s/timeline/parts/compositor/parts/html-tree.ts"],"names":[],"mappings":"AACA,OAAO,EAA4C,WAAW,EAAC,MAAM,mBAAmB,CAAA;AAExF,MAAM,eAAgB,SAAQ,WAAmC;IAC1C;IAAwC;IAA9D,YAAsB,KAA4B,EAAY,OAAoB;QACjF,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;QADA,UAAK,GAAL,KAAK,CAAuB;QAAY,YAAO,GAAP,OAAO,CAAa;IAElF,CAAC;IAED,kBAAkB,CAAC,QAAwC;QAC1D,OAAO;YACN,YAAY,EAAE,CAAC,IAAY,EAAE,EAAE;gBAC9B,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;oBAC9B,IAAI,KAAK,CAAC,KAAK;wBAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;gBAChD,CAAC;YACF,CAAC;SACD,CAAA;IACF,CAAC;IACD,qBAAqB,CAAC,QAAwC;QAC7D,OAAO;YACN,YAAY,EAAE,CAAC,IAAY,EAAE,EAAE;gBAC9B,IAAI,SAAS,GAAG,IAAI,CAAA;gBACpB,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;oBAC9B,IAAI,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;wBAChC,IAAI,KAAK,CAAC,KAAK;4BAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;wBACpD,MAAK;oBACN,CAAC;oBACD,SAAS,IAAI,KAAK,CAAC,QAAQ,CAAA;gBAC5B,CAAC;YACF,CAAC;SACD,CAAA;IACF,CAAC;CACD;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAc,EAAE,KAA4B,EAAE,OAAoB;IACnG,MAAM,OAAO,GAAG,IAAI,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IACnD,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;AAC3B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type RealtimeController = {
|
|
2
|
+
play(): void;
|
|
3
|
+
pause(): void;
|
|
4
|
+
seek(t: number): void;
|
|
5
|
+
dispose(): void;
|
|
6
|
+
setFPS(v: number): void;
|
|
7
|
+
isPlaying(): boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const realtime: (onTick: (t: number) => void) => RealtimeController;
|
|
10
|
+
export type FixedStepOptions = {
|
|
11
|
+
fps: number;
|
|
12
|
+
duration: number;
|
|
13
|
+
abort?: AbortSignal;
|
|
14
|
+
};
|
|
15
|
+
export declare const fixedStep: (opts: FixedStepOptions, onFrame: (t: number, index: number) => Promise<void> | void) => Promise<void>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export const realtime = (onTick) => {
|
|
2
|
+
let playing = false;
|
|
3
|
+
let rafId = null;
|
|
4
|
+
let fps = 60;
|
|
5
|
+
let frameDuration = 1000 / fps;
|
|
6
|
+
let currentTimeS = 0;
|
|
7
|
+
let lastTime = 0;
|
|
8
|
+
let accumulator = 0;
|
|
9
|
+
const tick = (now) => {
|
|
10
|
+
if (!playing)
|
|
11
|
+
return;
|
|
12
|
+
const deltaTime = now - lastTime;
|
|
13
|
+
lastTime = now;
|
|
14
|
+
accumulator += deltaTime;
|
|
15
|
+
while (accumulator >= frameDuration) {
|
|
16
|
+
onTick(currentTimeS);
|
|
17
|
+
currentTimeS += frameDuration / 1000;
|
|
18
|
+
accumulator -= frameDuration;
|
|
19
|
+
}
|
|
20
|
+
rafId = requestAnimationFrame(tick);
|
|
21
|
+
};
|
|
22
|
+
return {
|
|
23
|
+
play() {
|
|
24
|
+
if (playing)
|
|
25
|
+
return;
|
|
26
|
+
playing = true;
|
|
27
|
+
lastTime = performance.now();
|
|
28
|
+
rafId = requestAnimationFrame(tick);
|
|
29
|
+
},
|
|
30
|
+
pause() {
|
|
31
|
+
if (!playing)
|
|
32
|
+
return;
|
|
33
|
+
playing = false;
|
|
34
|
+
if (rafId !== null)
|
|
35
|
+
cancelAnimationFrame(rafId);
|
|
36
|
+
rafId = null;
|
|
37
|
+
},
|
|
38
|
+
seek(t) {
|
|
39
|
+
currentTimeS = Math.max(0, t);
|
|
40
|
+
accumulator = 0;
|
|
41
|
+
},
|
|
42
|
+
dispose() {
|
|
43
|
+
this.pause();
|
|
44
|
+
},
|
|
45
|
+
isPlaying() {
|
|
46
|
+
return playing;
|
|
47
|
+
},
|
|
48
|
+
setFPS(v) {
|
|
49
|
+
fps = v;
|
|
50
|
+
frameDuration = 1000 / fps;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export const fixedStep = async (opts, onFrame) => {
|
|
55
|
+
const dt = 1 / opts.fps;
|
|
56
|
+
const total = Math.ceil(opts.duration * opts.fps);
|
|
57
|
+
for (let i = 0; i < total; i++) {
|
|
58
|
+
if (opts.abort?.aborted)
|
|
59
|
+
break;
|
|
60
|
+
const t = i * dt;
|
|
61
|
+
await onFrame(t, i);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=schedulers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedulers.js","sourceRoot":"","sources":["../../../../../s/timeline/parts/compositor/parts/schedulers.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,MAA2B,EAAsB,EAAE;IAC1E,IAAI,OAAO,GAAG,KAAK,CAAA;IACnB,IAAI,KAAK,GAAkB,IAAI,CAAA;IAC/B,IAAI,GAAG,GAAG,EAAE,CAAA;IAEZ,IAAI,aAAa,GAAG,IAAI,GAAG,GAAG,CAAA;IAC9B,IAAI,YAAY,GAAG,CAAC,CAAA;IACpB,IAAI,QAAQ,GAAG,CAAC,CAAA;IAChB,IAAI,WAAW,GAAG,CAAC,CAAA;IAEnB,MAAM,IAAI,GAAG,CAAC,GAAW,EAAE,EAAE;QAC3B,IAAI,CAAC,OAAO;YAAE,OAAM;QAEpB,MAAM,SAAS,GAAG,GAAG,GAAG,QAAQ,CAAA;QAChC,QAAQ,GAAG,GAAG,CAAA;QAEd,WAAW,IAAI,SAAS,CAAA;QAExB,OAAO,WAAW,IAAI,aAAa,EAAE,CAAC;YACpC,MAAM,CAAC,YAAY,CAAC,CAAA;YACpB,YAAY,IAAI,aAAa,GAAG,IAAI,CAAA;YACpC,WAAW,IAAI,aAAa,CAAA;QAC9B,CAAC;QAED,KAAK,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAA;IACrC,CAAC,CAAA;IAED,OAAO;QACL,IAAI;YACF,IAAI,OAAO;gBAAE,OAAM;YACnB,OAAO,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+1,37 @@
|
|
|
1
|
+
import { Item } from "../../item.js";
|
|
2
|
+
import { Layer } from "../../../../driver/fns/schematic.js";
|
|
3
|
+
import { Mat6 } from "../../../utils/matrix.js";
|
|
4
|
+
export type AudioStreamComponent = {
|
|
5
|
+
getStream: () => AsyncGenerator<AudioData>;
|
|
6
|
+
};
|
|
7
|
+
export type AudioPlaybackComponent = {
|
|
8
|
+
onTimeUpdate: (time: number) => void;
|
|
9
|
+
};
|
|
10
|
+
export type VisualComponent = {
|
|
11
|
+
sampleAt: (time: number) => Promise<Layer[]>;
|
|
12
|
+
};
|
|
13
|
+
export type Node<T> = {
|
|
14
|
+
duration: number;
|
|
15
|
+
visuals?: VisualComponent;
|
|
16
|
+
audio?: T;
|
|
17
|
+
};
|
|
18
|
+
interface Sampler<T> {
|
|
19
|
+
video(item: Item.Video, parentMatrix: Mat6): Promise<Node<T>>;
|
|
20
|
+
audio(item: Item.Audio): Promise<Node<T>>;
|
|
21
|
+
dispose(): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export declare const getWorldMat6: (items: Map<number, Item.Any>, item: Item.Text | Item.Sequence | Item.Stack | Item.Video, parent?: Mat6) => Mat6;
|
|
24
|
+
export type WebcodecsSampler = Sampler<AudioStreamComponent>;
|
|
25
|
+
export interface HTMLSampler extends Sampler<AudioPlaybackComponent> {
|
|
26
|
+
setPaused(v: boolean): void;
|
|
27
|
+
}
|
|
28
|
+
export declare abstract class TreeBuilder<T> {
|
|
29
|
+
#private;
|
|
30
|
+
protected items: Map<number, Item.Any>;
|
|
31
|
+
protected sampler: Sampler<T>;
|
|
32
|
+
constructor(items: Map<number, Item.Any>, sampler: Sampler<T>);
|
|
33
|
+
build(root: Item.Any, parentMatrix?: Mat6): Promise<Node<T>>;
|
|
34
|
+
abstract composeAudio_Stack(children: Node<T>[]): T | undefined;
|
|
35
|
+
abstract composeAudio_Sequence(children: Node<T>[]): T | undefined;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { Kind } from "../../item.js";
|
|
2
|
+
import { I6, mul6, transformToMat6 } from "../../../utils/matrix.js";
|
|
3
|
+
const requireItem = (items, id) => items.get(id);
|
|
4
|
+
export const getWorldMat6 = (items, item, parent) => {
|
|
5
|
+
let world = parent ?? I6;
|
|
6
|
+
if (item.spatialId) {
|
|
7
|
+
const spatial = requireItem(items, item.spatialId);
|
|
8
|
+
const local = transformToMat6(spatial.transform);
|
|
9
|
+
world = mul6(local, world);
|
|
10
|
+
}
|
|
11
|
+
return world;
|
|
12
|
+
};
|
|
13
|
+
export class TreeBuilder {
|
|
14
|
+
items;
|
|
15
|
+
sampler;
|
|
16
|
+
constructor(items, sampler) {
|
|
17
|
+
this.items = items;
|
|
18
|
+
this.sampler = sampler;
|
|
19
|
+
}
|
|
20
|
+
async build(root, parentMatrix) {
|
|
21
|
+
switch (root.kind) {
|
|
22
|
+
case Kind.Video: return this.sampler.video(root, getWorldMat6(this.items, root, parentMatrix));
|
|
23
|
+
case Kind.Audio: return this.sampler.audio(root);
|
|
24
|
+
case Kind.Text: {
|
|
25
|
+
const matrix = getWorldMat6(this.items, root, parentMatrix);
|
|
26
|
+
return {
|
|
27
|
+
duration: Infinity,
|
|
28
|
+
visuals: {
|
|
29
|
+
sampleAt: async () => [{ kind: "text", content: root.content, color: "white", fontSize: 48, matrix }]
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
case Kind.Gap: return {
|
|
34
|
+
duration: root.duration,
|
|
35
|
+
visuals: {
|
|
36
|
+
sampleAt: async () => []
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
case Kind.Stack: {
|
|
40
|
+
const matrix = getWorldMat6(this.items, root, parentMatrix);
|
|
41
|
+
const children = await Promise.all(root.childrenIds.map(id => this.build(requireItem(this.items, id), matrix)));
|
|
42
|
+
return this.#composeStack(children);
|
|
43
|
+
}
|
|
44
|
+
case Kind.Sequence: {
|
|
45
|
+
const matrix = getWorldMat6(this.items, root, parentMatrix);
|
|
46
|
+
return this.#composeSequence(root, matrix);
|
|
47
|
+
}
|
|
48
|
+
default: return { duration: 0 };
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Visual composition is the same for both builders, so it lives here.
|
|
52
|
+
#composeVisuals_Stack(children) {
|
|
53
|
+
return {
|
|
54
|
+
sampleAt: async (time) => {
|
|
55
|
+
const layers = await Promise.all(children.map(c => c.visuals ? c.visuals.sampleAt(time) : Promise.resolve([])));
|
|
56
|
+
return layers.flat();
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
#composeVisuals_Sequence(children) {
|
|
61
|
+
return {
|
|
62
|
+
sampleAt: async (time) => {
|
|
63
|
+
let localTime = time;
|
|
64
|
+
for (const child of children) {
|
|
65
|
+
if (localTime < child.duration)
|
|
66
|
+
return child.visuals ? child.visuals.sampleAt(localTime) : [];
|
|
67
|
+
localTime -= child.duration;
|
|
68
|
+
}
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
#composeStack(children) {
|
|
74
|
+
const duration = Math.max(0, ...children.map(k => (Number.isFinite(k.duration) ? k.duration : 0)));
|
|
75
|
+
return {
|
|
76
|
+
duration,
|
|
77
|
+
visuals: this.#composeVisuals_Stack(children),
|
|
78
|
+
audio: this.composeAudio_Stack(children),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
async #composeSequence(sequence, parentMatrix) {
|
|
82
|
+
const childItems = sequence.childrenIds.map(id => requireItem(this.items, id));
|
|
83
|
+
const children = await this.#processChildren(childItems, parentMatrix);
|
|
84
|
+
const duration = children.reduce((a, k) => a + k.duration, 0);
|
|
85
|
+
return {
|
|
86
|
+
duration,
|
|
87
|
+
visuals: this.#composeVisuals_Sequence(children),
|
|
88
|
+
audio: this.composeAudio_Sequence(children),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
async #processChildren(childItems, parentMatrix) {
|
|
92
|
+
const processedNodes = [];
|
|
93
|
+
for (let i = 0; i < childItems.length; i++) {
|
|
94
|
+
const item = childItems[i];
|
|
95
|
+
if (item.kind !== Kind.Transition) {
|
|
96
|
+
processedNodes.push(await this.build(item, parentMatrix));
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const outgoingNode = processedNodes.pop();
|
|
100
|
+
const incomingItem = childItems[i + 1];
|
|
101
|
+
if (!outgoingNode || !incomingItem || incomingItem.kind === Kind.Transition) {
|
|
102
|
+
if (outgoingNode)
|
|
103
|
+
processedNodes.push(outgoingNode);
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
const incomingNode = await this.build(incomingItem, parentMatrix);
|
|
107
|
+
const transitionNode = await this.#createTransitionNode(item, outgoingNode, incomingNode);
|
|
108
|
+
processedNodes.push(transitionNode);
|
|
109
|
+
i++;
|
|
110
|
+
}
|
|
111
|
+
return processedNodes;
|
|
112
|
+
}
|
|
113
|
+
async #createTransitionNode(transitionItem, outgoingNode, incomingNode) {
|
|
114
|
+
const overlap = Math.max(0, Math.min(transitionItem.duration, outgoingNode.duration, incomingNode.duration));
|
|
115
|
+
const start = Math.max(0, outgoingNode.duration - overlap);
|
|
116
|
+
const combinedDuration = outgoingNode.duration + incomingNode.duration - overlap;
|
|
117
|
+
return {
|
|
118
|
+
duration: combinedDuration,
|
|
119
|
+
visuals: {
|
|
120
|
+
sampleAt: async (t) => {
|
|
121
|
+
if (!outgoingNode.visuals || !incomingNode.visuals)
|
|
122
|
+
return [];
|
|
123
|
+
if (t < start)
|
|
124
|
+
return outgoingNode.visuals.sampleAt(t);
|
|
125
|
+
if (t < outgoingNode.duration) {
|
|
126
|
+
const localTime = t - start;
|
|
127
|
+
const progress = overlap > 0 ? (localTime / overlap) : 1;
|
|
128
|
+
const from = await outgoingNode.visuals.sampleAt(t);
|
|
129
|
+
const to = await incomingNode.visuals.sampleAt(localTime);
|
|
130
|
+
if (!from[0]?.frame || !to[0]?.frame)
|
|
131
|
+
return [];
|
|
132
|
+
return [{
|
|
133
|
+
kind: "transition",
|
|
134
|
+
name: "circle",
|
|
135
|
+
progress,
|
|
136
|
+
from: from[0].frame,
|
|
137
|
+
to: to[0].frame,
|
|
138
|
+
}];
|
|
139
|
+
}
|
|
140
|
+
return incomingNode.visuals.sampleAt(t - outgoingNode.duration + overlap);
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
audio: this.composeAudio_Sequence([outgoingNode, incomingNode])
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=tree-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-builder.js","sourceRoot":"","sources":["../../../../../s/timeline/parts/compositor/parts/tree-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,IAAI,EAAC,MAAM,eAAe,CAAA;AAExC,OAAO,EAAC,EAAE,EAAQ,IAAI,EAAE,eAAe,EAAC,MAAM,0BAA0B,CAAA;AAwBxE,MAAM,WAAW,GAAG,CAAC,KAA4B,EAAE,EAAU,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAE,CAAA;AAChF,MAAM,CAAC,MAAM,YAAY,GAAG,CAC3B,KAA4B,EAC5B,IAAyD,EACzD,MAAa,EACN,EAAE;IACT,IAAI,KAAK,GAAG,MAAM,IAAI,EAAE,CAAA;IACxB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;QACpB,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAiB,CAAA;QAClE,MAAM,KAAK,GAAG,eAAe,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;QAChD,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;IAC3B,CAAC;IACD,OAAO,KAAK,CAAA;AACb,CAAC,CAAA;AAOD,MAAM,OAAgB,WAAW;IACV;IAAwC;IAA9D,YAAsB,KAA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I,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK;gCACnB,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK;6BACf,CAAC,CAAA;oBACH,CAAC;oBACD,OAAO,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,YAAY,CAAC,QAAQ,GAAG,OAAO,CAAC,CAAA;gBAC1E,CAAC;aACD;YACD,KAAK,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;SAC/D,CAAA;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Item } from "../../item.js";
|
|
2
|
+
import { AudioStreamComponent, Node, WebcodecsSampler } from "./tree-builder.js";
|
|
3
|
+
export declare function buildWebCodecsNodeTree(root: Item.Any, items: Map<number, Item.Any>, sampler: WebcodecsSampler): Promise<Node<AudioStreamComponent>>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TreeBuilder } from "./tree-builder.js";
|
|
2
|
+
class WebCodecsNodeBuilder extends TreeBuilder {
|
|
3
|
+
composeAudio_Stack(children) {
|
|
4
|
+
return {
|
|
5
|
+
getStream: async function* () {
|
|
6
|
+
for (const child of children) {
|
|
7
|
+
if (child.audio)
|
|
8
|
+
yield* child.audio.getStream();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
composeAudio_Sequence(children) {
|
|
14
|
+
return {
|
|
15
|
+
getStream: async function* () {
|
|
16
|
+
for (const child of children) {
|
|
17
|
+
if (child.audio)
|
|
18
|
+
yield* child.audio.getStream();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export function buildWebCodecsNodeTree(root, items, sampler) {
|
|
25
|
+
const builder = new WebCodecsNodeBuilder(items, sampler);
|
|
26
|
+
return builder.build(root);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=webcodecs-tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webcodecs-tree.js","sourceRoot":"","sources":["../../../../../s/timeline/parts/compositor/parts/webcodecs-tree.ts"],"names":[],"mappings":"AACA,OAAO,EAA+C,WAAW,EAAC,MAAM,mBAAmB,CAAA;AAE3F,MAAM,oBAAqB,SAAQ,WAAiC;IACnE,kBAAkB,CAAC,QAAsC;QACxD,OAAO;YACN,SAAS,EAAE,KAAK,SAAS,CAAC;gBACzB,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;oBAC9B,IAAI,KAAK,CAAC,KAAK;wBACd,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,CAAA;gBAChC,CAAC;YACF,CAAC;SACD,CAAA;IACF,CAAC;IACD,qBAAqB,CAAC,QAAsC;QAC3D,OAAO;YACN,SAAS,EAAE,KAAK,SAAS,CAAC;gBACzB,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;oBAC9B,IAAI,KAAK,CAAC,KAAK;wBACd,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,CAAA;gBAChC,CAAC;YACF,CAAC;SACD,CAAA;IACF,CAAC;CACD;AAED,MAAM,UAAU,sBAAsB,CAAC,IAAc,EAAE,KAA4B,EAAE,OAAyB;IAC7G,MAAM,OAAO,GAAG,IAAI,oBAAoB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IACxD,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;AAC3B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TimelineFile } from "../basics.js";
|
|
2
|
+
import { DecoderSource } from "../../../driver/fns/schematic.js";
|
|
3
|
+
import { AudioPlaybackComponent, HTMLSampler, Node } from "./parts/tree-builder.js";
|
|
4
|
+
type ResolveMedia = (hash: string) => DecoderSource;
|
|
5
|
+
export declare class VideoPlayer {
|
|
6
|
+
#private;
|
|
7
|
+
canvas: HTMLCanvasElement;
|
|
8
|
+
private root;
|
|
9
|
+
private sampler;
|
|
10
|
+
private resolveMedia;
|
|
11
|
+
constructor(canvas: HTMLCanvasElement, root: Node<AudioPlaybackComponent>, sampler: HTMLSampler, resolveMedia?: ResolveMedia);
|
|
12
|
+
get context(): CanvasRenderingContext2D;
|
|
13
|
+
static create(timeline: TimelineFile): Promise<VideoPlayer>;
|
|
14
|
+
play(): Promise<void>;
|
|
15
|
+
pause(): void;
|
|
16
|
+
seek(time: number): Promise<void>;
|
|
17
|
+
setFPS(value: number): void;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { context } from "../../../context.js";
|
|
2
|
+
import { realtime } from "./parts/schedulers.js";
|
|
3
|
+
import { makeHtmlSampler } from "./samplers/html.js";
|
|
4
|
+
import { buildHTMLNodeTree } from "./parts/html-tree.js";
|
|
5
|
+
export class VideoPlayer {
|
|
6
|
+
canvas;
|
|
7
|
+
root;
|
|
8
|
+
sampler;
|
|
9
|
+
resolveMedia;
|
|
10
|
+
#controller = realtime(t => this.#tick(t));
|
|
11
|
+
constructor(canvas, root, sampler, resolveMedia = _hash => "/assets/temp/gl.mp4") {
|
|
12
|
+
this.canvas = canvas;
|
|
13
|
+
this.root = root;
|
|
14
|
+
this.sampler = sampler;
|
|
15
|
+
this.resolveMedia = resolveMedia;
|
|
16
|
+
this.#controller.setFPS(30);
|
|
17
|
+
}
|
|
18
|
+
get context() {
|
|
19
|
+
return this.canvas.getContext("2d");
|
|
20
|
+
}
|
|
21
|
+
static async create(timeline) {
|
|
22
|
+
const rootItem = new Map(timeline.items.map(i => [i.id, i])).get(timeline.rootId);
|
|
23
|
+
const items = new Map(timeline.items.map(i => [i.id, i]));
|
|
24
|
+
const sampler = makeHtmlSampler(() => "/assets/temp/gl.mp4");
|
|
25
|
+
const root = await buildHTMLNodeTree(rootItem, items, sampler);
|
|
26
|
+
const canvas = document.createElement("canvas");
|
|
27
|
+
canvas.width = 1920;
|
|
28
|
+
canvas.height = 1080;
|
|
29
|
+
return new this(canvas, root, sampler);
|
|
30
|
+
}
|
|
31
|
+
async #tick(t) {
|
|
32
|
+
const driver = await context.driver;
|
|
33
|
+
const dur = this.root.duration;
|
|
34
|
+
const tt = t > dur ? dur : t;
|
|
35
|
+
this.root.audio?.onTimeUpdate(tt);
|
|
36
|
+
for (const layer of await this.root.visuals?.sampleAt(tt) ?? []) {
|
|
37
|
+
const frame = await driver.composite(layer);
|
|
38
|
+
this.context.drawImage(frame, 0, 0);
|
|
39
|
+
frame.close();
|
|
40
|
+
}
|
|
41
|
+
if (t >= dur)
|
|
42
|
+
this.pause();
|
|
43
|
+
}
|
|
44
|
+
async play() {
|
|
45
|
+
if (!this.#controller.isPlaying()) {
|
|
46
|
+
this.sampler.setPaused(false);
|
|
47
|
+
this.#controller.play();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
pause() {
|
|
51
|
+
if (this.#controller.isPlaying()) {
|
|
52
|
+
this.#controller.pause();
|
|
53
|
+
this.sampler.setPaused(true);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async seek(time) {
|
|
57
|
+
const driver = await context.driver;
|
|
58
|
+
this.pause();
|
|
59
|
+
this.#controller.seek(time);
|
|
60
|
+
this.root.audio?.onTimeUpdate(time);
|
|
61
|
+
for (const draw of await this.root.visuals?.sampleAt(time) ?? []) {
|
|
62
|
+
const frame = await driver.composite(draw);
|
|
63
|
+
this.context.drawImage(frame, 0, 0);
|
|
64
|
+
frame.close();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
setFPS(value) {
|
|
68
|
+
this.#controller.setFPS(value);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=playback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playback.js","sourceRoot":"","sources":["../../../../s/timeline/parts/compositor/playback.ts"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