manim-web 0.3.20 → 0.3.22
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/README.md +20 -0
- package/dist/AmsConfiguration-OUoC_kJ0.js +847 -0
- package/dist/AmsConfiguration-tdje_HlF.js +847 -0
- package/dist/ConfigMacrosConfiguration-4OaQYvlr.js +46 -0
- package/dist/ConfigMacrosConfiguration-DM3-S5M8.js +46 -0
- package/dist/Entities-Dw6381dl.js +429 -0
- package/dist/Entities-bJKKDYjE.js +429 -0
- package/dist/Factory-Ba6Nqb3M.js +107 -0
- package/dist/HtmlNode-1mFtYQ9G.js +981 -0
- package/dist/HtmlNode-CQqo5we-.js +981 -0
- package/dist/InputJax-D5R2pqUk.js +41 -0
- package/dist/InputJax-jNvwWU5P.js +41 -0
- package/dist/NewcommandConfiguration-BN_OlLcO.js +32 -0
- package/dist/NewcommandConfiguration-DZ3mSCpD.js +32 -0
- package/dist/NewcommandMethods-D5bueYYE.js +187 -0
- package/dist/NewcommandMethods-DTf_dan5.js +187 -0
- package/dist/Options-DMK2wYar.js +63 -0
- package/dist/ParseMethods-Deqa7kJ6.js +2636 -0
- package/dist/ParseMethods-Dt5bYDSZ.js +2636 -0
- package/dist/Styles-BILrGVps.js +293 -0
- package/dist/Styles-DQSruwWe.js +293 -0
- package/dist/animation/Animation.d.ts +15 -0
- package/dist/animation/Animation.d.ts.map +1 -1
- package/dist/animation/MasterTimeline.d.ts +88 -1
- package/dist/animation/MasterTimeline.d.ts.map +1 -1
- package/dist/animation/movement/Rotate.d.ts +2 -7
- package/dist/animation/movement/Rotate.d.ts.map +1 -1
- package/dist/animation/transform/FadeMorphStrategy.d.ts +18 -0
- package/dist/animation/transform/FadeMorphStrategy.d.ts.map +1 -0
- package/dist/animation/transform/FadeTransforms.d.ts +2 -0
- package/dist/animation/transform/FadeTransforms.d.ts.map +1 -1
- package/dist/animation/transform/MorphStrategy.d.ts +8 -0
- package/dist/animation/transform/MorphStrategy.d.ts.map +1 -0
- package/dist/animation/transform/MovementTransforms.d.ts.map +1 -1
- package/dist/animation/transform/PointMorphStrategy.d.ts +36 -0
- package/dist/animation/transform/PointMorphStrategy.d.ts.map +1 -0
- package/dist/animation/transform/ShapeMorphStrategy.d.ts +39 -0
- package/dist/animation/transform/ShapeMorphStrategy.d.ts.map +1 -0
- package/dist/animation/transform/Transform.d.ts +9 -91
- package/dist/animation/transform/Transform.d.ts.map +1 -1
- package/dist/animation/transform/TransformMatching.d.ts.map +1 -1
- package/dist/animation/transform/TransformMatchingBase.d.ts +1 -0
- package/dist/animation/transform/TransformMatchingBase.d.ts.map +1 -1
- package/dist/animation/transform/TransformMatchingShared.d.ts +37 -0
- package/dist/animation/transform/TransformMatchingShared.d.ts.map +1 -0
- package/dist/animation/transform/TransformPairing.d.ts +19 -0
- package/dist/animation/transform/TransformPairing.d.ts.map +1 -0
- package/dist/core/AnimateProxy.d.ts +4 -5
- package/dist/core/AnimateProxy.d.ts.map +1 -1
- package/dist/core/Camera.d.ts +37 -0
- package/dist/core/Camera.d.ts.map +1 -1
- package/dist/core/CameraExtensions.d.ts +33 -1
- package/dist/core/CameraExtensions.d.ts.map +1 -1
- package/dist/core/Group.d.ts +5 -11
- package/dist/core/Group.d.ts.map +1 -1
- package/dist/core/Mobject.d.ts +39 -7
- package/dist/core/Mobject.d.ts.map +1 -1
- package/dist/core/MobjectPositioning.d.ts +2 -5
- package/dist/core/MobjectPositioning.d.ts.map +1 -1
- package/dist/core/MobjectTypes.d.ts +21 -4
- package/dist/core/MobjectTypes.d.ts.map +1 -1
- package/dist/core/Renderer.d.ts +3 -0
- package/dist/core/Renderer.d.ts.map +1 -1
- package/dist/core/Scene.d.ts +50 -0
- package/dist/core/Scene.d.ts.map +1 -1
- package/dist/core/TexturedMobject.d.ts +38 -0
- package/dist/core/TexturedMobject.d.ts.map +1 -0
- package/dist/core/ThreeDScene.d.ts +18 -3
- package/dist/core/ThreeDScene.d.ts.map +1 -1
- package/dist/core/VGroup.d.ts +11 -19
- package/dist/core/VGroup.d.ts.map +1 -1
- package/dist/core/VMobject.d.ts +48 -110
- package/dist/core/VMobject.d.ts.map +1 -1
- package/dist/core/VMobjectCurveUtils.d.ts +106 -0
- package/dist/core/VMobjectCurveUtils.d.ts.map +1 -0
- package/dist/core/VMobjectGeometry.d.ts +22 -25
- package/dist/core/VMobjectGeometry.d.ts.map +1 -1
- package/dist/core/VMobjectRendering.d.ts +5 -0
- package/dist/core/VMobjectRendering.d.ts.map +1 -1
- package/dist/core/VMobjectStrokeGeometry.d.ts +20 -0
- package/dist/core/VMobjectStrokeGeometry.d.ts.map +1 -0
- package/dist/core/VMobjectTransformAlignment.d.ts +20 -0
- package/dist/core/VMobjectTransformAlignment.d.ts.map +1 -0
- package/dist/html-Bza5WY1y.js +829 -0
- package/dist/html-bhzMuE8p.js +829 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -4
- package/dist/integrations/react.js +16 -18
- package/dist/integrations/vue.js +15 -17
- package/dist/interaction/Draggable.d.ts +2 -0
- package/dist/interaction/Draggable.d.ts.map +1 -1
- package/dist/interaction/OrbitControls.d.ts +1 -1
- package/dist/interaction/OrbitControls.d.ts.map +1 -1
- package/dist/lengths-D2zTYMUu.js +54 -0
- package/dist/liteAdaptor-BkxB5CGC.js +616 -0
- package/dist/liteAdaptor-LMKuWwg1.js +616 -0
- package/dist/manim-web.browser.js +35821 -30916
- package/dist/mathjax-CPQWkQEv.js +121 -0
- package/dist/mathjax-b-GTdZgw.js +121 -0
- package/dist/mo-D4wFHS6V.js +2675 -0
- package/dist/mo-hAX79Dzl.js +2675 -0
- package/dist/mobjects/geometry/AngleShapes.d.ts +0 -4
- package/dist/mobjects/geometry/AngleShapes.d.ts.map +1 -1
- package/dist/mobjects/geometry/BooleanOperations.d.ts +1 -1
- package/dist/mobjects/geometry/BooleanOperations.d.ts.map +1 -1
- package/dist/mobjects/geometry/CubicBezier.d.ts.map +1 -1
- package/dist/mobjects/geometry/PolygonExtensions.d.ts +1 -1
- package/dist/mobjects/geometry/PolygonExtensions.d.ts.map +1 -1
- package/dist/mobjects/graphing/ComplexPlane.d.ts +59 -1
- package/dist/mobjects/graphing/ComplexPlane.d.ts.map +1 -1
- package/dist/mobjects/graphing/Vector.d.ts.map +1 -1
- package/dist/mobjects/image/index.d.ts +9 -2
- package/dist/mobjects/image/index.d.ts.map +1 -1
- package/dist/mobjects/point/Mobject1D.d.ts.map +1 -1
- package/dist/mobjects/point/Mobject2D.d.ts.map +1 -1
- package/dist/mobjects/point/PMobject.d.ts +8 -2
- package/dist/mobjects/point/PMobject.d.ts.map +1 -1
- package/dist/mobjects/point/PointMobject.d.ts.map +1 -1
- package/dist/mobjects/text/Code.d.ts.map +1 -1
- package/dist/mobjects/text/MarkupText.d.ts.map +1 -1
- package/dist/mobjects/text/MathJaxRenderer.d.ts.map +1 -1
- package/dist/mobjects/text/MathTex.d.ts +9 -0
- package/dist/mobjects/text/MathTex.d.ts.map +1 -1
- package/dist/mobjects/text/MathTexImage.d.ts +9 -3
- package/dist/mobjects/text/MathTexImage.d.ts.map +1 -1
- package/dist/mobjects/text/Text.d.ts +8 -3
- package/dist/mobjects/text/Text.d.ts.map +1 -1
- package/dist/mobjects/text/TextGlyphGroup.d.ts.map +1 -1
- package/dist/mobjects/text/svgPathParser.d.ts.map +1 -1
- package/dist/mobjects/three-d/Line3D.d.ts +10 -56
- package/dist/mobjects/three-d/Line3D.d.ts.map +1 -1
- package/dist/mobjects/three-d/ThreeDAxes.d.ts +8 -0
- package/dist/mobjects/three-d/ThreeDAxes.d.ts.map +1 -1
- package/dist/player/Player.d.ts +36 -29
- package/dist/player/Player.d.ts.map +1 -1
- package/dist/player/PlayerUI.d.ts.map +1 -1
- package/dist/player/RecordingScene.d.ts +37 -0
- package/dist/player/RecordingScene.d.ts.map +1 -0
- package/dist/{src-Db7QTr4S.js → src-BlTk3Bta.js} +34386 -29482
- package/dist/svg-DNS5Hwhk.js +28713 -0
- package/dist/svg-DVUoAdmC.js +28713 -0
- package/dist/test-setup/vitest-setup.d.ts +20 -0
- package/dist/test-setup/vitest-setup.d.ts.map +1 -0
- package/dist/tex-BQCLd0dF.js +1427 -0
- package/dist/tex-Cd_bTYKG.js +1427 -0
- package/dist/utils/axis.d.ts +4 -0
- package/dist/utils/axis.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +37 -0
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/math.d.ts +11 -0
- package/dist/utils/math.d.ts.map +1 -1
- package/dist/utils/vectors.d.ts +54 -1
- package/dist/utils/vectors.d.ts.map +1 -1
- package/package.json +10 -8
- package/dist/AllPackages-B0GtkYjD.js +0 -7912
- package/dist/AllPackages-BIAELuhU.js +0 -7912
- package/dist/BaseConfiguration-CDf44lxS.js +0 -4402
- package/dist/BaseConfiguration-Chcqjv9L.js +0 -4402
- package/dist/Entities-B_gwJfrn.js +0 -458
- package/dist/Entities-CmJkmuw_.js +0 -458
- package/dist/GifExporter-C9lP34Iu.js +0 -338
- package/dist/GifExporter-DBak5Vk7.js +0 -338
- package/dist/InputJax-C5sGfjJ8.js +0 -43
- package/dist/InputJax-Jb4hSThK.js +0 -43
- package/dist/MathItem-BmK41eqe.js +0 -77
- package/dist/MathItem-C_mZyaeT.js +0 -77
- package/dist/Options-Ch1vGsgd.js +0 -188
- package/dist/Options-V6ag48Dv.js +0 -188
- package/dist/PrioritizedList-DkoCmqPk.js +0 -36
- package/dist/PrioritizedList-eKTii0tW.js +0 -36
- package/dist/Styles-De4BjKiV.js +0 -411
- package/dist/Styles-DgoiBrzf.js +0 -411
- package/dist/TeXAtom-DT2wCvcU.js +0 -2025
- package/dist/TeXAtom-JogI0lus.js +0 -2025
- package/dist/VideoExporter-Bdtz_pWv.js +0 -102
- package/dist/VideoExporter-Vjfsnv1h.js +0 -102
- package/dist/chunk-3e0lkp8x.js +0 -23
- package/dist/html-53__O8r2.js +0 -1587
- package/dist/html-DfHFh5II.js +0 -1587
- package/dist/lengths-3epoqRj7.js +0 -65
- package/dist/lengths-B-bX9Tfk.js +0 -65
- package/dist/liteAdaptor-BxFvlO-q.js +0 -828
- package/dist/liteAdaptor-CsOIKw2g.js +0 -828
- package/dist/mathjax-Bkrmftxh.js +0 -102
- package/dist/mathjax-DBrTNl9C.js +0 -102
- package/dist/mo-AzagC5AD.js +0 -3271
- package/dist/mo-I_6dyJsk.js +0 -3271
- package/dist/svg-CoGQ_sAt.js +0 -23880
- package/dist/svg-DiIG93Lr.js +0 -23880
- package/dist/tex-ChPKMfdv.js +0 -401
- package/dist/tex-hYZcjadW.js +0 -401
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./chunk-3e0lkp8x.js";
|
|
2
|
-
//#region src/export/VideoExporter.ts
|
|
3
|
-
var t = /* @__PURE__ */ e({
|
|
4
|
-
VideoExporter: () => n,
|
|
5
|
-
createVideoExporter: () => r
|
|
6
|
-
}), n = class e {
|
|
7
|
-
_scene;
|
|
8
|
-
_options;
|
|
9
|
-
_mediaRecorder = null;
|
|
10
|
-
_recordedChunks = [];
|
|
11
|
-
_isRecording = !1;
|
|
12
|
-
constructor(e, t) {
|
|
13
|
-
this._scene = e, this._options = {
|
|
14
|
-
fps: t?.fps ?? 60,
|
|
15
|
-
quality: t?.quality ?? .9,
|
|
16
|
-
format: t?.format ?? "webm",
|
|
17
|
-
width: t?.width ?? e.getWidth(),
|
|
18
|
-
height: t?.height ?? e.getHeight(),
|
|
19
|
-
duration: t?.duration ?? 0,
|
|
20
|
-
onProgress: t?.onProgress ?? (() => {}),
|
|
21
|
-
includeAudio: t?.includeAudio ?? !0,
|
|
22
|
-
audioManager: t?.audioManager ?? null
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
_getAudioManager() {
|
|
26
|
-
if (this._options.audioManager) return this._options.audioManager;
|
|
27
|
-
try {
|
|
28
|
-
let e = this._scene.audioManager;
|
|
29
|
-
return e.tracks.length > 0 ? e : null;
|
|
30
|
-
} catch (e) {
|
|
31
|
-
return console.warn("AudioManager unavailable; exporting without audio:", e), null;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
async startRecording() {
|
|
35
|
-
if (this._isRecording) throw Error("Already recording");
|
|
36
|
-
let e = this._scene.getCanvas().captureStream(this._options.fps), t = this._options.includeAudio ? this._getAudioManager() : null, n;
|
|
37
|
-
if (t && t.tracks.length > 0) {
|
|
38
|
-
let r = t.createStreamDestination().stream.getAudioTracks();
|
|
39
|
-
n = new MediaStream([...e.getVideoTracks(), ...r]);
|
|
40
|
-
} else n = e;
|
|
41
|
-
let r;
|
|
42
|
-
if (this._options.format === "webm" ? r = "video/webm;codecs=vp9" : this._options.format === "mov" ? MediaRecorder.isTypeSupported("video/quicktime") ? r = "video/quicktime" : (console.warn("MOV format not supported by this browser, falling back to WebM"), r = "video/webm;codecs=vp9") : r = "video/mp4", !MediaRecorder.isTypeSupported(r)) throw Error(`Format ${r} is not supported by this browser`);
|
|
43
|
-
this._recordedChunks = [], this._mediaRecorder = new MediaRecorder(n, {
|
|
44
|
-
mimeType: r,
|
|
45
|
-
videoBitsPerSecond: Math.floor(this._options.quality * 1e7)
|
|
46
|
-
}), this._mediaRecorder.ondataavailable = (e) => {
|
|
47
|
-
e.data.size > 0 && this._recordedChunks.push(e.data);
|
|
48
|
-
}, this._mediaRecorder.start(), this._isRecording = !0;
|
|
49
|
-
}
|
|
50
|
-
async stopRecording() {
|
|
51
|
-
return new Promise((e, t) => {
|
|
52
|
-
if (!this._mediaRecorder || !this._isRecording) {
|
|
53
|
-
t(/* @__PURE__ */ Error("Not recording"));
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
this._mediaRecorder.onstop = () => {
|
|
57
|
-
let t;
|
|
58
|
-
t = this._options.format === "webm" ? "video/webm" : this._options.format === "mov" ? "video/quicktime" : "video/mp4";
|
|
59
|
-
let n = new Blob(this._recordedChunks, { type: t });
|
|
60
|
-
this._isRecording = !1, e(n);
|
|
61
|
-
}, this._mediaRecorder.stop();
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
async exportTimeline(e) {
|
|
65
|
-
let t = e ?? this._options.duration ?? this._scene.getTimelineDuration() ?? 5, n = Math.ceil(t * this._options.fps), r = 1 / this._options.fps, i = this._options.includeAudio ? this._getAudioManager() : null;
|
|
66
|
-
i && i.tracks.length > 0 && i.seek(0), await this.startRecording(), i && i.tracks.length > 0 && i.play();
|
|
67
|
-
for (let e = 0; e < n; e++) {
|
|
68
|
-
let t = e * r;
|
|
69
|
-
this._scene.seek(t), await new Promise((e) => requestAnimationFrame(e)), this._options.onProgress(e / n);
|
|
70
|
-
}
|
|
71
|
-
return i && i.isPlaying && i.stop(), this.stopRecording();
|
|
72
|
-
}
|
|
73
|
-
async exportAudio(e) {
|
|
74
|
-
let t = this._getAudioManager();
|
|
75
|
-
if (!t || t.tracks.length === 0) return null;
|
|
76
|
-
let n = e ?? this._options.duration ?? this._scene.getTimelineDuration() ?? 5;
|
|
77
|
-
return t.exportWAV(n);
|
|
78
|
-
}
|
|
79
|
-
static download(e, t = "animation.webm") {
|
|
80
|
-
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
81
|
-
r.href = n, r.download = t, document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(n);
|
|
82
|
-
}
|
|
83
|
-
async exportAndDownload(t, n) {
|
|
84
|
-
let r = await this.exportTimeline(n), i = {
|
|
85
|
-
webm: ".webm",
|
|
86
|
-
mp4: ".mp4",
|
|
87
|
-
mov: ".mov"
|
|
88
|
-
}[this._options.format] ?? ".webm";
|
|
89
|
-
e.download(r, t ?? `animation${i}`);
|
|
90
|
-
}
|
|
91
|
-
isRecording() {
|
|
92
|
-
return this._isRecording;
|
|
93
|
-
}
|
|
94
|
-
getOptions() {
|
|
95
|
-
return { ...this._options };
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
function r(e, t) {
|
|
99
|
-
return new n(e, t);
|
|
100
|
-
}
|
|
101
|
-
//#endregion
|
|
102
|
-
export { t as n, r, n as t };
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./chunk-3e0lkp8x.js";
|
|
2
|
-
//#region src/export/VideoExporter.ts
|
|
3
|
-
var t = /* @__PURE__ */ e({
|
|
4
|
-
VideoExporter: () => n,
|
|
5
|
-
createVideoExporter: () => r
|
|
6
|
-
}), n = class e {
|
|
7
|
-
_scene;
|
|
8
|
-
_options;
|
|
9
|
-
_mediaRecorder = null;
|
|
10
|
-
_recordedChunks = [];
|
|
11
|
-
_isRecording = !1;
|
|
12
|
-
constructor(e, t) {
|
|
13
|
-
this._scene = e, this._options = {
|
|
14
|
-
fps: t?.fps ?? 60,
|
|
15
|
-
quality: t?.quality ?? .9,
|
|
16
|
-
format: t?.format ?? "webm",
|
|
17
|
-
width: t?.width ?? e.getWidth(),
|
|
18
|
-
height: t?.height ?? e.getHeight(),
|
|
19
|
-
duration: t?.duration ?? 0,
|
|
20
|
-
onProgress: t?.onProgress ?? (() => {}),
|
|
21
|
-
includeAudio: t?.includeAudio ?? !0,
|
|
22
|
-
audioManager: t?.audioManager ?? null
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
_getAudioManager() {
|
|
26
|
-
if (this._options.audioManager) return this._options.audioManager;
|
|
27
|
-
try {
|
|
28
|
-
let e = this._scene.audioManager;
|
|
29
|
-
return e.tracks.length > 0 ? e : null;
|
|
30
|
-
} catch (e) {
|
|
31
|
-
return console.warn("AudioManager unavailable; exporting without audio:", e), null;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
async startRecording() {
|
|
35
|
-
if (this._isRecording) throw Error("Already recording");
|
|
36
|
-
let e = this._scene.getCanvas().captureStream(this._options.fps), t = this._options.includeAudio ? this._getAudioManager() : null, n;
|
|
37
|
-
if (t && t.tracks.length > 0) {
|
|
38
|
-
let r = t.createStreamDestination().stream.getAudioTracks();
|
|
39
|
-
n = new MediaStream([...e.getVideoTracks(), ...r]);
|
|
40
|
-
} else n = e;
|
|
41
|
-
let r;
|
|
42
|
-
if (this._options.format === "webm" ? r = "video/webm;codecs=vp9" : this._options.format === "mov" ? MediaRecorder.isTypeSupported("video/quicktime") ? r = "video/quicktime" : (console.warn("MOV format not supported by this browser, falling back to WebM"), r = "video/webm;codecs=vp9") : r = "video/mp4", !MediaRecorder.isTypeSupported(r)) throw Error(`Format ${r} is not supported by this browser`);
|
|
43
|
-
this._recordedChunks = [], this._mediaRecorder = new MediaRecorder(n, {
|
|
44
|
-
mimeType: r,
|
|
45
|
-
videoBitsPerSecond: Math.floor(this._options.quality * 1e7)
|
|
46
|
-
}), this._mediaRecorder.ondataavailable = (e) => {
|
|
47
|
-
e.data.size > 0 && this._recordedChunks.push(e.data);
|
|
48
|
-
}, this._mediaRecorder.start(), this._isRecording = !0;
|
|
49
|
-
}
|
|
50
|
-
async stopRecording() {
|
|
51
|
-
return new Promise((e, t) => {
|
|
52
|
-
if (!this._mediaRecorder || !this._isRecording) {
|
|
53
|
-
t(/* @__PURE__ */ Error("Not recording"));
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
this._mediaRecorder.onstop = () => {
|
|
57
|
-
let t;
|
|
58
|
-
t = this._options.format === "webm" ? "video/webm" : this._options.format === "mov" ? "video/quicktime" : "video/mp4";
|
|
59
|
-
let n = new Blob(this._recordedChunks, { type: t });
|
|
60
|
-
this._isRecording = !1, e(n);
|
|
61
|
-
}, this._mediaRecorder.stop();
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
async exportTimeline(e) {
|
|
65
|
-
let t = e ?? this._options.duration ?? this._scene.getTimelineDuration() ?? 5, n = Math.ceil(t * this._options.fps), r = 1 / this._options.fps, i = this._options.includeAudio ? this._getAudioManager() : null;
|
|
66
|
-
i && i.tracks.length > 0 && i.seek(0), await this.startRecording(), i && i.tracks.length > 0 && i.play();
|
|
67
|
-
for (let e = 0; e < n; e++) {
|
|
68
|
-
let t = e * r;
|
|
69
|
-
this._scene.seek(t), await new Promise((e) => requestAnimationFrame(e)), this._options.onProgress(e / n);
|
|
70
|
-
}
|
|
71
|
-
return i && i.isPlaying && i.stop(), this.stopRecording();
|
|
72
|
-
}
|
|
73
|
-
async exportAudio(e) {
|
|
74
|
-
let t = this._getAudioManager();
|
|
75
|
-
if (!t || t.tracks.length === 0) return null;
|
|
76
|
-
let n = e ?? this._options.duration ?? this._scene.getTimelineDuration() ?? 5;
|
|
77
|
-
return t.exportWAV(n);
|
|
78
|
-
}
|
|
79
|
-
static download(e, t = "animation.webm") {
|
|
80
|
-
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
81
|
-
r.href = n, r.download = t, document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(n);
|
|
82
|
-
}
|
|
83
|
-
async exportAndDownload(t, n) {
|
|
84
|
-
let r = await this.exportTimeline(n), i = {
|
|
85
|
-
webm: ".webm",
|
|
86
|
-
mp4: ".mp4",
|
|
87
|
-
mov: ".mov"
|
|
88
|
-
}[this._options.format] ?? ".webm";
|
|
89
|
-
e.download(r, t ?? `animation${i}`);
|
|
90
|
-
}
|
|
91
|
-
isRecording() {
|
|
92
|
-
return this._isRecording;
|
|
93
|
-
}
|
|
94
|
-
getOptions() {
|
|
95
|
-
return { ...this._options };
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
function r(e, t) {
|
|
99
|
-
return new n(e, t);
|
|
100
|
-
}
|
|
101
|
-
//#endregion
|
|
102
|
-
export { t as n, r, n as t };
|
package/dist/chunk-3e0lkp8x.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, n) => {
|
|
3
|
-
let r = {};
|
|
4
|
-
for (var i in e) t(r, i, {
|
|
5
|
-
get: e[i],
|
|
6
|
-
enumerable: !0
|
|
7
|
-
});
|
|
8
|
-
return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
|
-
}, c = (e, i, o, s) => {
|
|
10
|
-
if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
|
|
11
|
-
get: ((e) => i[e]).bind(null, d),
|
|
12
|
-
enumerable: !(s = n(i, d)) || s.enumerable
|
|
13
|
-
});
|
|
14
|
-
return e;
|
|
15
|
-
}, l = (n, r, a) => (a = n == null ? {} : e(i(n)), c(r || !n || !n.__esModule ? t(a, "default", {
|
|
16
|
-
value: n,
|
|
17
|
-
enumerable: !0
|
|
18
|
-
}) : a, n)), u = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
19
|
-
if (typeof require < "u") return require.apply(this, arguments);
|
|
20
|
-
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
21
|
-
});
|
|
22
|
-
//#endregion
|
|
23
|
-
export { l as i, s as n, u as r, o as t };
|