🎥 Make videos programmatically with React
`remotion`: Fix staticFile() in SSR
Jonny Burger6df943f19e6c
diff --git a/packages/core/src/animated-image/resolve-image-source.tsx b/packages/core/src/animated-image/resolve-image-source.tsxindex 47437a0732..2fec78e9bc 100644--- a/packages/core/src/animated-image/resolve-image-source.tsx+++ b/packages/core/src/animated-image/resolve-image-source.tsx@@ -1,4 +1,7 @@export const resolveAnimatedImageSource = (src: string): string => {- return new URL(src, typeof window === 'undefined' ? undefined : window.origin)- .href;+ if (typeof window === 'undefined') {+ return src;+ }++ return new URL(src, window.origin).href;};diff --git a/packages/gif/src/get-gif-duration-in-seconds.ts b/packages/gif/src/get-gif-duration-in-seconds.tsindex e5855c5ee9..5920de7be7 100644--- a/packages/gif/src/get-gif-duration-in-seconds.ts+++ b/packages/gif/src/get-gif-duration-in-seconds.ts@@ -2,6 +2,7 @@ import {getRemotionEnvironment} from 'remotion';import {manuallyManagedGifCache, volatileGifCache} from './gif-cache';import type {GifState} from './props';import {parseGif, parseWithWorker} from './react-tools';+import {resolveGifSource} from './resolve-gif-source';const calcDuration = (parsed: GifState) => {return (@@ -14,7 +15,7 @@ const calcDuration = (parsed: GifState) => {* @see [Documentation](https://remotion.dev/docs/gif/get-gif-duration-in-seconds)*/export const getGifDurationInSeconds = async (src: string) => {- const resolvedSrc = new URL(src, window.origin).href;+ const resolvedSrc = resolveGifSource(src);const inCache =volatileGifCache.get(resolvedSrc) ??manuallyManagedGifCache.get(resolvedSrc);