MCPcopy Create free account
hub / github.com/core7s/react-design-editor / loadVideoEditorAssets

Function loadVideoEditorAssets

src/utils/video.ts:49–69  ·  view source on GitHub ↗
(payload: IScene)

Source from the content-addressed store, hash-verified

47}
48
49export const loadVideoEditorAssets = async (payload: IScene) => {
50 const layers: Partial<ILayer>[] = []
51 for (const layer of payload.layers) {
52 if (layer.type === "StaticVideo") {
53 // @ts-ignore
54 const video = await loadVideoResource(layer.src)
55 const frame = (await captureFrame(video)) as string
56 const duration = await captureDuration(video)
57 layers.push({
58 ...layer,
59 preview: frame,
60 })
61 } else {
62 layers.push(layer)
63 }
64 }
65 return {
66 ...payload,
67 layers: layers,
68 }
69}

Callers 3

loadGraphicTemplateFunction · 0.90
loadPresentationTemplateFunction · 0.90
loadVideoTemplateFunction · 0.90

Calls 3

loadVideoResourceFunction · 0.70
captureFrameFunction · 0.70
captureDurationFunction · 0.70

Tested by

no test coverage detected