🎥 Make videos programmatically with React
support http url for assets
yuta0801f96756392ea1
diff --git a/packages/renderer/src/stitcher.ts b/packages/renderer/src/stitcher.tsindex 5032cf5a4e..2d0f471ac2 100644--- a/packages/renderer/src/stitcher.ts+++ b/packages/renderer/src/stitcher.ts@@ -62,7 +62,7 @@ export const stitchFramesToVideo = async (options: {);Internals.validateSelectedPixelFormatAndCodecCombination(pixelFormat, codec);- const assetPaths = options.assets.map((asset) => url.fileURLToPath(asset.src));+ const assetPaths = options.assets.map((asset) => resolveAssetSrc(asset.src));const assetAudioDetails = await getAssetAudioDetails({assetPaths,cwd: options.dir,@@ -101,7 +101,9 @@ export const stitchFramesToVideo = async (options: {(asset.startInVideo / options.fps) *1000).toFixed(); // in milliseconds- const audioDetails = assetAudioDetails.get(url.fileURLToPath(asset.src));+ const audioDetails = assetAudioDetails.get(+ resolveAssetSrc(asset.src)+ );return [`[${i + 1}:a]`,@@ -135,3 +137,11 @@ export const stitchFramesToVideo = async (options: {});await task;};++const resolveAssetSrc = (src: string) => {+ const {protocol} = new URL(src);++ if (protocol === 'file:') return url.fileURLToPath(src);++ return src;+};