🎥 Make videos programmatically with React
`remotion`: Enable buffering until first frame is playing
Jonny Burger34168b4552cf
diff --git a/packages/core/src/buffer-until-first-frame.ts b/packages/core/src/buffer-until-first-frame.tsindex 27e0c2edcf..0bab976839 100644--- a/packages/core/src/buffer-until-first-frame.ts+++ b/packages/core/src/buffer-until-first-frame.ts@@ -10,6 +10,12 @@ const isSafariWebkit = () => {return isSafari;};+const isDesktopChrome = () => {+ const isChrome = /chrome/i.test(window.navigator.userAgent);+ const isDesktop = !/mobile/i.test(window.navigator.userAgent);+ return isChrome && isDesktop;+};+export const useBufferUntilFirstFrame = ({mediaRef,mediaType,@@ -44,10 +50,19 @@ export const useBufferUntilFirstFrame = ({return;}- if (current.readyState >= current.HAVE_ENOUGH_DATA && !isSafariWebkit()) {+ if (+ current.readyState >= current.HAVE_ENOUGH_DATA &&+ !isSafariWebkit() &&+ // In Desktop Chrome, the video might switch to playing+ // but does not play due to Bluetooth headphones++ // Enabling back this flag for Chrome without extensive testing+ // because we never had big problems on Chrome+ !isDesktopChrome()+ ) {playbackLogging({logLevel,- message: `Not using buffer until first frame, because readyState is ${current.readyState} and is not Safari`,+ message: `Not using buffer until first frame, because readyState is ${current.readyState} and is not Safari or Desktop Chrome`,mountTime,tag: 'buffer',});