(payload: IScene)
| 47 | } |
| 48 | |
| 49 | export 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 | } |
no test coverage detected