🐛 fix(video_subtitle_embedding): 确保视频和字幕嵌入准备就绪
This commit is contained in:
@@ -43,6 +43,7 @@ export const useVideoSubtitleEmbedding = async (
|
|||||||
new MP4Clip((await fetch(videoUrl)).body!)
|
new MP4Clip((await fetch(videoUrl)).body!)
|
||||||
);
|
);
|
||||||
videoSprite.time = { duration: 10e6, offset: 0 };
|
videoSprite.time = { duration: 10e6, offset: 0 };
|
||||||
|
await videoSprite.ready;
|
||||||
|
|
||||||
const srtSprite = new OffscreenSprite(
|
const srtSprite = new OffscreenSprite(
|
||||||
new EmbedSubtitlesClip(await (await fetch(srtUrl)).text(), {
|
new EmbedSubtitlesClip(await (await fetch(srtUrl)).text(), {
|
||||||
@@ -60,6 +61,7 @@ export const useVideoSubtitleEmbedding = async (
|
|||||||
...options,
|
...options,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
await srtSprite.ready;
|
||||||
srtSprite.time = { duration: 10e6, offset: 0 };
|
srtSprite.time = { duration: 10e6, offset: 0 };
|
||||||
|
|
||||||
const combinator = new Combinator({
|
const combinator = new Combinator({
|
||||||
|
|||||||
2303
pnpm-lock.yaml
generated
2303
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user