diff --git a/package.json b/package.json index c8611cc3..1d47b7d2 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ "vite-plugin-dts": "^4.5.4" }, "dependencies": { - "@shotstack/schemas": "1.25.0", + "@shotstack/schemas": "1.27.0", "@shotstack/shotstack-canvas": "2.15.0", "howler": "^2.2.4", "mediabunny": "1.65.2", diff --git a/tests/edit-clip-operations.test.ts b/tests/edit-clip-operations.test.ts index 153fc9da..94c7ac4b 100644 --- a/tests/edit-clip-operations.test.ts +++ b/tests/edit-clip-operations.test.ts @@ -1050,6 +1050,33 @@ describe("Edit Clip Operations", () => { }); }); + describe("mute", () => { + it("keeps a clip's mute through load and export", async () => { + const mutedEdit = new Edit({ + timeline: { + tracks: [ + { + clips: [ + { + asset: { type: "audio", src: "https://example.com/voice.mp3", mute: { words: ["bob"], sound: "bleep" } }, + start: 0, + length: 5 + } + ] + } + ] + }, + output: { size: { width: 1920, height: 1080 }, format: "mp4" } + }); + await mutedEdit.load(); + + expect(mutedEdit.getEdit().timeline.tracks[0]?.clips[0]?.asset).toMatchObject({ + mute: { words: ["bob"], sound: "bleep" } + }); + mutedEdit.dispose(); + }); + }); + describe("clip operations undo integration", () => { it("addClip undo removes the added clip", async () => { await edit.addClip(0, createVideoClip(0, 5)); diff --git a/tests/mute-load.test.ts b/tests/mute-load.test.ts new file mode 100644 index 00000000..042c3d57 --- /dev/null +++ b/tests/mute-load.test.ts @@ -0,0 +1,26 @@ +import { EditSchema } from "../src/core/schemas"; + +describe("mute", () => { + it("accepts a clip that bleeps its muted words", () => { + const edit = { + timeline: { + tracks: [ + { + clips: [ + { + asset: { type: "video", src: "https://example.com/interview.mp4", mute: { words: ["bob"], sound: "bleep" } }, + start: 0, + length: 5 + } + ] + } + ] + }, + output: { format: "mp4", size: { width: 1280, height: 720 } } + }; + + expect(EditSchema.parse(edit).timeline.tracks[0]?.clips[0]?.asset).toMatchObject({ + mute: { words: ["bob"], sound: "bleep" } + }); + }); +});