🎥 Make videos programmatically with React
Rename `<Video>` to `<Html5Video>`
JonnyBurgerc6d96159923b
diff --git a/packages/ai-improvements/.jsdoc/offthreadvideo b/packages/ai-improvements/.jsdoc/offthreadvideoindex cecdf9d183..ed8b054aa0 100644--- a/packages/ai-improvements/.jsdoc/offthreadvideo+++ b/packages/ai-improvements/.jsdoc/offthreadvideo@@ -1,4 +1,4 @@/**- * @description This method imports and displays a video, similar to <Video />. During rendering, it extracts the exact frame from the video and displays it in an <img> tag+ * @description This method imports and displays a video, similar to <Html5Video />. During rendering, it extracts the exact frame from the video and displays it in an <img> tag* @see [Documentation](https://www.remotion.dev/docs/offthreadvideo)*/\ No newline at end of filediff --git a/packages/core/src/test/video.test.tsx b/packages/core/src/test/video.test.tsxindex b566eaa121..fd74454366 100644--- a/packages/core/src/test/video.test.tsx+++ b/packages/core/src/test/video.test.tsx@@ -1,6 +1,6 @@import {cleanup, render} from '@testing-library/react';import {beforeEach, expect, test} from 'bun:test';-import {Video} from '../video/index.js';+import {Html5Video} from '../video/index.js';import {WrapSequenceContext} from './wrap-sequence-context.js';beforeEach(() => {@@ -11,7 +11,7 @@ test('It should render Video without startFrom / endAt props', () => {expect(() =>render(<WrapSequenceContext>- <Video src="test" />+ <Html5Video src="test" /></WrapSequenceContext>,),).not.toThrow();@@ -20,7 +20,7 @@ test('It should render Video with startFrom props', () => {expect(() =>render(<WrapSequenceContext>- <Video src="test" startFrom={10} />+ <Html5Video src="test" startFrom={10} /></WrapSequenceContext>,),).not.toThrow();@@ -29,7 +29,7 @@ test('It should render Video with endAt props', () => {expect(() =>render(<WrapSequenceContext>- <Video src="test" endAt={10} />+ <Html5Video src="test" endAt={10} /></WrapSequenceContext>,),).not.toThrow();@@ -38,7 +38,7 @@ test('It should render Video with startFrom and endAt props', () => {expect(() =>render(<WrapSequenceContext>- <Video src="test" startFrom={10} endAt={15} />+ <Html5Video src="test" startFrom={10} endAt={15} /></WrapSequenceContext>,),).not.toThrow();@@ -48,7 +48,7 @@ test('It should render Video with trimBefore props', () => {expect(() =>render(<WrapSequenceContext>- <Video src="test" trimBefore={10} />+ <Html5Video src="test" trimBefore={10} /></WrapSequenceContext>,),).not.toThrow();@@ -57,7 +57,7 @@ test('It should render Video with trimAfter props', () => {expect(() =>render(<WrapSequenceContext>- <Video src="test" trimAfter={10} />+ <Html5Video src="test" trimAfter={10} /></WrapSequenceContext>,),).not.toThrow();@@ -66,7 +66,7 @@ test('It should render Video with trimBefore and trimAfter props', () => {expect(() =>render(<WrapSequenceContext>- <Video src="test" trimBefore={10} trimAfter={15} />+ <Html5Video src="test" trimBefore={10} trimAfter={15} /></WrapSequenceContext>,),).not.toThrow();@@ -76,7 +76,7 @@ test('It should throw when both startFrom and trimBefore are provided', () => {expect(() =>render(<WrapSequenceContext>- <Video src="test" startFrom={10} trimBefore={5} />+ <Html5Video src="test" startFrom={10} trimBefore={5} /></WrapSequenceContext>,),).toThrow(/Cannot use both startFrom and trimBefore props/);@@ -86,7 +86,7 @@ test('It should throw when both endAt and trimAfter are provided', () => {expect(() =>render(<WrapSequenceContext>- <Video src="test" endAt={15} trimAfter={20} />+ <Html5Video src="test" endAt={15} trimAfter={20} /></WrapSequenceContext>,),).toThrow(/Cannot use both endAt and trimAfter props/);diff --git a/packages/core/src/video/OffthreadVideo.tsx b/packages/core/src/video/OffthreadVideo.tsxindex 8e7eecba56..1743d795c4 100644--- a/packages/core/src/video/OffthreadVideo.tsx+++ b/packages/core/src/video/OffthreadVideo.tsx@@ -124,7 +124,7 @@ export const InnerOffthreadVideo: React.FC<AllOffthreadVideoProps> = (};/*- * @description This method imports and displays a video, similar to <Video />. During rendering, it extracts the exact frame from the video and displays it in an <img> tag+ * @description This method imports and displays a video, similar to <Html5Video />. During rendering, it extracts the exact frame from the video and displays it in an <img> tag* @see [Documentation](https://www.remotion.dev/docs/offthreadvideo)*/diff --git a/packages/core/src/video/Video.tsx b/packages/core/src/video/Video.tsxindex d149eaa96f..8ab6a85e78 100644--- a/packages/core/src/video/Video.tsx+++ b/packages/core/src/video/Video.tsx@@ -53,7 +53,7 @@ const VideoForwardingFunction: React.ForwardRefRenderFunction<if (typeof props.src !== 'string') {throw new TypeError(- `The \`<Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(+ `The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src,)} instead.`,);diff --git a/packages/core/src/video/VideoForRendering.tsx b/packages/core/src/video/VideoForRendering.tsxindex b744e6fc8f..3d6dbbc8e4 100644--- a/packages/core/src/video/VideoForRendering.tsx+++ b/packages/core/src/video/VideoForRendering.tsx@@ -167,7 +167,7 @@ const VideoForRenderingForwardFunction: React.ForwardRefRenderFunction<fps: videoConfig.fps,});const handle = delayRender(- `Rendering <Video /> with src="${props.src}" at time ${currentTime}`,+ `Rendering <Html5Video /> with src="${props.src}" at time ${currentTime}`,{retries: delayRenderRetries ?? undefined,timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined,@@ -266,7 +266,7 @@ const VideoForRenderingForwardFunction: React.ForwardRefRenderFunction<}const newHandle = delayRender(- 'Loading <Video> duration with src=' + src,+ 'Loading <Html5Video> duration with src=' + src,{retries: delayRenderRetries ?? undefined,timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined,diff --git a/packages/docs/blog/2021-02-26-remotion-1-4.mdx b/packages/docs/blog/2021-02-26-remotion-1-4.mdxindex 6f02d408ca..38cfaff8f6 100644--- a/packages/docs/blog/2021-02-26-remotion-1-4.mdx+++ b/packages/docs/blog/2021-02-26-remotion-1-4.mdx@@ -162,7 +162,7 @@ Since Remotion [will make money by selling licenses to bigger companies](https:/- [Ensure minimum node version](https://github.com/remotion-dev/remotion/pull/117)-- [Fix flickering `<Video>`](https://github.com/remotion-dev/remotion/pull/118)+- [Fix flickering `<Html5Video>`](https://github.com/remotion-dev/remotion/pull/118)- [Clean up frames after rendering](https://github.com/remotion-dev/remotion/pull/127)diff --git a/packages/docs/blog/2021-07-09-remotion-2-2.mdx b/packages/docs/blog/2021-07-09-remotion-2-2.mdxindex 6196a0eb25..45008ae58b 100644--- a/packages/docs/blog/2021-07-09-remotion-2-2.mdx+++ b/packages/docs/blog/2021-07-09-remotion-2-2.mdx@@ -25,13 +25,13 @@ This new core component will freeze all of it's children and make them think thaYou can use it for example to display a still frame from a video:```tsx twoslash title="MyVideo.tsx"-import {Freeze, Video} from 'remotion';+import {Freeze, Html5Video} from 'remotion';import myVid from './vid.mp4';export const MyVideo = () => {return (<Freeze frame={30}>- <Video src={myVid} />+ <Html5Video src={myVid} /></Freeze>);};@@ -46,11 +46,11 @@ However, it works for any content. As you can see the API is dead simple! You caThis prop allows you to slow down or speed up video and audio elements! Now you can import a video in normal speed and play it in slow motion or timelapse without re-rendering the video.```tsx twoslash title="LightningSpeed.tsx"-import {Video} from 'remotion';+import {Html5Video} from 'remotion';import myVid from './vid.mp4';export const MyVideo = () => {- return <Video src={myVid} playbackRate={4} />;+ return <Html5Video src={myVid} playbackRate={4} />;};```diff --git a/packages/docs/components/3DPhone/Scene.tsx b/packages/docs/components/3DPhone/Scene.tsxindex f6f0d734bb..b90f26d811 100644--- a/packages/docs/components/3DPhone/Scene.tsx+++ b/packages/docs/components/3DPhone/Scene.tsx@@ -3,7 +3,7 @@ import type {VideoMetadata} from '@remotion/media-utils';import {getVideoMetadata} from '@remotion/media-utils';import {ThreeCanvas, useVideoTexture} from '@remotion/three';import React, {useEffect, useRef, useState} from 'react';-import {AbsoluteFill, useVideoConfig, Video} from 'remotion';+import {AbsoluteFill, Html5Video, useVideoConfig} from 'remotion';import {Phone} from './Phone';const videoStyle: React.CSSProperties = {@@ -28,7 +28,7 @@ export const Scene: React.FC<{const texture = useVideoTexture(videoRef);return (<AbsoluteFill>- <Video ref={videoRef} src={videoSrc} style={videoStyle} />+ <Html5Video ref={videoRef} src={videoSrc} style={videoStyle} />{videoData ? (<ThreeCanvas width={width} height={height}><ambientLight intensity={1.5} color={0xffffff} />diff --git a/packages/docs/components/AcceleratedVideoPlayerExample.tsx b/packages/docs/components/AcceleratedVideoPlayerExample.tsxindex 61a091e8fc..ee69f013f0 100644--- a/packages/docs/components/AcceleratedVideoPlayerExample.tsx+++ b/packages/docs/components/AcceleratedVideoPlayerExample.tsx@@ -1,6 +1,6 @@import {Player} from '@remotion/player';import React from 'react';-import {interpolate, Sequence, useCurrentFrame, Video} from 'remotion';+import {Html5Video, interpolate, Sequence, useCurrentFrame} from 'remotion';const remapSpeed = ({frame,@@ -31,7 +31,7 @@ const AcceleratedVideo: React.FC = () => {return (<Sequence from={frame}>- <Video+ <Html5VideotrimBefore={Math.round(remappedFrame)}playbackRate={speedFunction(frame)}src="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4#disable"diff --git a/packages/docs/docs/buffer-state.mdx b/packages/docs/docs/buffer-state.mdxdeleted file mode 100644index 6e2adbba48..0000000000--- a/packages/docs/docs/buffer-state.mdx+++ /dev/null@@ -1,391 +0,0 @@-----image: /generated/articles-docs-buffer-state.png-title: Display a buffer state-crumb: Building video apps------:::warning-Since Remotion v4.0.111, Remotion has a [native buffer state](/docs/player/buffer-state). The technique described on this page should only be used for older versions of Remotion.-:::--In your [`<Player>`](/docs/player), you might have videos and other assets that might take some time to load after they enter the scene.-You can [preload those assets](/docs/player/preloading), but sometimes browser policies prevent preloading and [a brief flash is possible](/docs/troubleshooting/player-flicker) while the browser needs to decode the video before playing.--In this case, you might want to pause the Player if media is loading and show a spinner, and unpause the video once the media is ready to play. This can be implemented using regular Web APIs and React primitives.--## Reference application--Visit this [GitHub repo](https://github.com/remotion-dev/video-buffering-example) to see a fully functioning example of this technique.--## Implementing a buffer state--We create a new React Context that can handle the buffering states of media inside our Player. We implement default functions that do nothing, since no buffer state is necessary during rendering.--```tsx title="BufferManager.tsx"-import {createContext} from 'react';--type BufferState = {[key: string]: boolean};--type BufferContextType = {- canPlay: (id: string) => void;- needsToBuffer: (id: string) => void;-};--export const BufferContext = createContext<BufferContextType>({- // By default, do nothing if the context is not set, for example in rendering- canPlay: () => {},- needsToBuffer: () => {},-});-```--The following component can be wrapped around the Player to provide it with the `onBuffer` and `onContinue` functions. By using a context, we don't have to pass those functions as props to every media element, even though it is also possible.--If one media element is buffering, it can register that to the manager using `onBuffer()`. If all media elements are loaded, the buffer manager will call the `onContinue()` event.--```tsx twoslash title="BufferManager.tsx"-import {createContext} from 'react';--type BufferState = {[key: string]: boolean};--type BufferContextType = {- canPlay: (id: string) => void;- needsToBuffer: (id: string) => void;-};--export const BufferContext = createContext<BufferContextType>({- // By default, do nothing if the context is not set, for example in rendering- canPlay: () => {},- needsToBuffer: () => {},-});--// ---cut----import {useCallback, useMemo, useRef} from 'react';--export const BufferManager: React.FC<{- children: React.ReactNode;- onBuffer: () => void;- onContinue: () => void;-}> = ({children, onBuffer, onContinue}) => {- const bufferState = useRef<BufferState>({});- const currentState = useRef(false);-- const sendEvents = useCallback(() => {- let previousState = currentState.current;- currentState.current = Object.values(bufferState.current).some(Boolean);-- if (currentState.current && !previousState) {- onBuffer();- } else if (!currentState.current && previousState) {- onContinue();- }- }, [onBuffer, onContinue]);-- const canPlay = useCallback(- (id: string) => {- bufferState.current[id] = false;- sendEvents();- },- [sendEvents],- );-- const needsToBuffer = useCallback(- (id: string) => {- bufferState.current[id] = true;- sendEvents();- },- [sendEvents],- );-- const bufferEvents = useMemo(() => {- return {- canPlay,- needsToBuffer,- };- }, [canPlay, needsToBuffer]);-- return <BufferContext.Provider value={bufferEvents}>{children}</BufferContext.Provider>;-};-```--## Making the `<Video>` report buffering--The following component `<PausableVideo>` wraps the `<Video>` tag, so that you can use it instead of it. It grabs the context we have defined beforehand and reports buffering and resuming of the video to the `BufferManager`.--```tsx twoslash title="PausableVideo.tsx"-// @filename: BufferManager.tsx--import React, {createContext, useCallback, useMemo, useRef} from 'react';--type BufferState = {[key: string]: boolean};--type BufferContextType = {- canPlay: (id: string) => void;- needsToBuffer: (id: string) => void;-};--export const BufferContext = createContext<BufferContextType>({- // By default, do nothing if the context is not set, for example in rendering- canPlay: () => {},- needsToBuffer: () => {},-});--export const BufferManager: React.FC<{- children: React.ReactNode;- onBuffer: () => void;- onContinue: () => void;-}> = ({children, onBuffer, onContinue}) => {- const bufferState = useRef<BufferState>({});- const currentState = useRef(false);-- const sendEvents = useCallback(() => {- let previousState = currentState.current;- currentState.current = Object.values(bufferState.current).some(Boolean);-- if (currentState.current && !previousState) {- onBuffer();- } else if (!currentState.current && previousState) {- onContinue();- }- }, [onBuffer, onContinue]);-- const canPlay = useCallback(- (id: string) => {- bufferState.current[id] = false;- sendEvents();- },- [sendEvents],- );-- const needsToBuffer = useCallback(- (id: string) => {- bufferState.current[id] = true;- sendEvents();- },- [sendEvents],- );-- const bufferEvents = useMemo(() => {- return {- canPlay,- needsToBuffer,- };- }, [canPlay, needsToBuffer]);-- return <BufferContext.Provider value={bufferEvents}>{children}</BufferContext.Provider>;-};-// organize-imports-ignore-// @filename: PausableVideo.tsx-// ---cut----import React, {forwardRef, useContext, useEffect, useId, useImperativeHandle, useRef} from 'react';-import {RemotionMainVideoProps, RemotionVideoProps, Video} from 'remotion';-import {BufferContext} from './BufferManager';--const PausableVideoFunction: React.ForwardRefRenderFunction<HTMLVideoElement, RemotionVideoProps & RemotionMainVideoProps> = ({src, ...props}, ref) => {- const videoRef = useRef<HTMLVideoElement>(null);-- const id = useId();-- useImperativeHandle(ref, () => videoRef.current as HTMLVideoElement);-- const {canPlay, needsToBuffer} = useContext(BufferContext);-- useEffect(() => {- const {current} = videoRef;- if (!current) {- return;- }-- const onPlay = () => {- canPlay(id);- };-- const onBuffer = () => {- needsToBuffer(id);- };-- current.addEventListener('canplay', onPlay);- current.addEventListener('waiting', onBuffer);-- return () => {- current.removeEventListener('canplay', onPlay);- current.removeEventListener('waiting', onBuffer);-- // If component is unmounted, unblock the buffer manager- canPlay(id);- };- }, [canPlay, id, needsToBuffer]);-- return <Video {...props} ref={videoRef} src={src} />;-};--export const PausableVideo = forwardRef(PausableVideoFunction);-```--If you are using `<OffthreadVideo>` instead, you cannot have a ref attached to it.-[Use this technique](/docs/video-tags#using-a-different-tag-in-preview-and-rendering) to use `<OffthreadVideo>` only during rendering.--Replace `<Video>` elements in your Remotion component with `<PausableVideoFunction>` to make them report buffering state.--## Pause video and display loading UI--Wrap your Player in the newly created `<BufferManager>`. Create two functions `onBuffer` and `onContinue` that implement what should happen if the video goes into a buffering state. Pass them to the `<BufferManager>`.--In this example, a ref is being used to track whether the video was paused due to buffering, so that the video will only be resumed in that case.-By using a ref, we eliminate the risk of asynchronous React state leading to a race condition.--```tsx twoslash title="App.tsx" {6-28,30,38}-// @filename: BufferManager.tsx-import {createContext} from 'react';--type BufferState = {[key: string]: boolean};--type BufferContextType = {- canPlay: (id: string) => void;- needsToBuffer: (id: string) => void;-};--export const BufferContext = createContext<BufferContextType>({- // By default, do nothing if the context is not set, for example in rendering- canPlay: () => {},- needsToBuffer: () => {},-});--// ---cut----import React, {useCallback, useMemo, useRef} from 'react';--export const BufferManager: React.FC<{- children: React.ReactNode;- onBuffer: () => void;- onContinue: () => void;-}> = ({children, onBuffer, onContinue}) => {- const bufferState = useRef<BufferState>({});- const currentState = useRef(false);-- const sendEvents = useCallback(() => {- let previousState = currentState.current;- currentState.current = Object.values(bufferState.current).some(Boolean);-- if (currentState.current && !previousState) {- onBuffer();- } else if (!currentState.current && previousState) {- onContinue();- }- }, [onBuffer, onContinue]);-- const canPlay = useCallback(- (id: string) => {- bufferState.current[id] = false;- sendEvents();- },- [sendEvents],- );-- const needsToBuffer = useCallback(- (id: string) => {- bufferState.current[id] = true;- sendEvents();- },- [sendEvents],- );-- const bufferEvents = useMemo(() => {- return {- canPlay,- needsToBuffer,- };- }, [canPlay, needsToBuffer]);-- return <BufferContext.Provider value={bufferEvents}>{children}</BufferContext.Provider>;-};--// @filename: App.tsx-const MyComp: React.FC = () => null;--// organize-imports-ignore-// ---cut----import {Player, PlayerRef} from '@remotion/player';-import React, {useState, useRef, useCallback} from 'react';-import {BufferManager} from './BufferManager';--function App() {- const playerRef = useRef<PlayerRef>(null);- const [buffering, setBuffering] = useState(false);- const pausedBecauseOfBuffering = useRef(false);-- const onBuffer = useCallback(() => {- setBuffering(true);-- playerRef.current?.pause();- pausedBecauseOfBuffering.current = true;- }, []);-- const onContinue = useCallback(() => {- setBuffering(false);-- // Play only if we paused because of buffering- if (pausedBecauseOfBuffering.current) {- pausedBecauseOfBuffering.current = false;- playerRef.current?.play();- }- }, []);-- return (- <BufferManager onBuffer={onBuffer} onContinue={onContinue}>- <Player ref={playerRef} component={MyComp} compositionHeight={720} compositionWidth={1280} durationInFrames={200} fps={30} controls />- </BufferManager>- );-}--export default App;-```--In addition to pausing the video, you can also display custom UI that will overlay the video while it is buffering. Usually, you would display a branded spinner, in this simplified example, we are showing a ⏳ emoji.--```tsx twoslash title="App.tsx" {1, 8-25,34-36}-const MyComp = () => null;-// ---cut----import {Player, RenderPoster} from '@remotion/player';-import {useCallback, useState} from 'react';-import {AbsoluteFill} from 'remotion';--function App() {- const [buffering, setBuffering] = useState();-- // Add this to your component rendering the <Player>- const renderPoster: RenderPoster = useCallback(() => {- if (buffering) {- return (- <AbsoluteFill- style={{- justifyContent: 'center',- alignItems: 'center',- fontSize: 100,- }}- >- ⏳- </AbsoluteFill>- );- }-- return null;- }, [buffering]);-- return (- <Player- fps={30}- component={MyComp}- compositionHeight={720}- compositionWidth={1280}- durationInFrames={200}- // Add these two props to the Player- showPosterWhenPaused- renderPoster={renderPoster}- />- );-}-```--## See also--- [Preloading assets](/docs/player/preloading)-- [Avoiding flickering in the `<Player>`](/docs/troubleshooting/player-flicker)diff --git a/packages/docs/docs/delay-render.mdx b/packages/docs/docs/delay-render.mdxindex 37370f502e..8e0886cd7a 100644--- a/packages/docs/docs/delay-render.mdx+++ b/packages/docs/docs/delay-render.mdx@@ -156,7 +156,7 @@ delayRender('Loading asset...', {});```-The [`<Img>`](/docs/img#delayrenderretries), [`<Html5Audio>`](/docs/html5-audio#delayrenderretries), [`<Video>`](/docs/html5-video#delayrenderretries) and [`<IFrame>`](/docs/iframe#delayrenderretries) tags support a `delayRenderRetries` prop to control the value of `retries` for the `delayRender()` call that those components make.+The [`<Img>`](/docs/img#delayrenderretries), [`<Html5Audio>`](/docs/html5-audio#delayrenderretries), [`<Html5Video>`](/docs/html5-video#delayrenderretries) and [`<IFrame>`](/docs/iframe#delayrenderretries) tags support a `delayRenderRetries` prop to control the value of `retries` for the `delayRender()` call that those components make.## Modifying the timeout<AvailableFrom v="4.0.140"/>diff --git a/packages/docs/docs/dynamic-metadata.mdx b/packages/docs/docs/dynamic-metadata.mdxindex 4f544a01d9..eb25aca08a 100644--- a/packages/docs/docs/dynamic-metadata.mdx+++ b/packages/docs/docs/dynamic-metadata.mdx@@ -17,7 +17,8 @@ Pass a [`calculateMetadata`](/docs/composition#calculatemetadata) callback funct```tsx twoslash title="src/Root.tsx"import {parseMedia} from '@remotion/media-parser';-import {Composition, Video} from 'remotion';+import {Composition} from 'remotion';+import {Video} from '@remotion/media';type MyCompProps = {src: string;diff --git a/packages/docs/docs/get-static-files.mdx b/packages/docs/docs/get-static-files.mdxindex d26e85c848..995db54ed6 100644--- a/packages/docs/docs/get-static-files.mdx+++ b/packages/docs/docs/get-static-files.mdx@@ -2,7 +2,7 @@image: /generated/articles-docs-get-static-files.pngid: getstaticfilestitle: getStaticFiles()-crumb: "API"+crumb: 'API'---_Available from v3.3.26._@@ -23,7 +23,8 @@ On Linux, watching for changes in subdirectories is only supported from Node.js:::```tsx twoslash title="example.ts"-import { getStaticFiles, StaticFile, Video } from "remotion";+import {getStaticFiles, StaticFile} from 'remotion';+import {Video} from '@remotion/media';const files = getStaticFiles();/*@@ -51,7 +52,7 @@ const videoSrc = files[0].src;// Find a file by it's name and import itconst data = files.find((f) => {- return f.name === "video.mp4";+ return f.name === 'video.mp4';}) as StaticFile; // Use `as StaticFile` to assert the file exists// Use the `src` property to get a src to pass to a media elementdiff --git a/packages/docs/docs/gpu.mdx b/packages/docs/docs/gpu.mdxindex a934dbe878..76bd4cf631 100644--- a/packages/docs/docs/gpu.mdx+++ b/packages/docs/docs/gpu.mdx@@ -29,7 +29,7 @@ slowdown in rendering time.Contrary to popular belief, the following content is not accelerated by the GPU:-- `<Video>`+- `<Html5Video>`- `<OffthreadVideo>`- [Canvas pixel manipulation](/docs/video-manipulation)diff --git a/packages/docs/docs/html5-audio.mdx b/packages/docs/docs/html5-audio.mdxindex 49353f0002..aff49b0167 100644--- a/packages/docs/docs/html5-audio.mdx+++ b/packages/docs/docs/html5-audio.mdx@@ -1,5 +1,5 @@----image: /generated/articles-docs-audio.png+image: /generated/articles-docs-html5-audio.pngtitle: <Html5Audio>id: html5-audiocrumb: 'API - remotion'diff --git a/packages/docs/docs/html5-video.mdx b/packages/docs/docs/html5-video.mdxindex 51eabb8800..6e66aed55e 100644--- a/packages/docs/docs/html5-video.mdx+++ b/packages/docs/docs/html5-video.mdx@@ -1,5 +1,5 @@----image: /generated/articles-docs-video.png+image: /generated/articles-docs-html5-video.pngtitle: <Html5Video>id: html5-videocrumb: 'API - remotion'@@ -20,12 +20,12 @@ Prefer [one of the other video tags](/docs/video-tags) which perform better.All the props that the native `<video>` element accepts (except `autoplay` and `controls`) will be forwarded (but of course not all are useful for Remotion). This means you can use all CSS to style the video.```tsx twoslash-import {AbsoluteFill, staticFile, Video} from 'remotion';+import {AbsoluteFill, staticFile, Html5Video} from 'remotion';export const MyComposition = () => {return (<AbsoluteFill>- <Video src={staticFile('video.webm')} />+ <Html5Video src={staticFile('video.webm')} /></AbsoluteFill>);};@@ -34,12 +34,12 @@ export const MyComposition = () => {You can load a video from an URL as well:```tsx twoslash-import {AbsoluteFill, Video} from 'remotion';+import {AbsoluteFill, Html5Video} from 'remotion';// ---cut---export const MyComposition = () => {return (<AbsoluteFill>- <Video src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" />+ <Html5Video src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" /></AbsoluteFill>);};@@ -65,13 +65,13 @@ The video will play the range from `00:02:00` to `00:04:00`, meaning the video wFor exact behavior, see: [Order of operations](/docs/audio/order-of-operations).```tsx twoslash-import {AbsoluteFill, staticFile, Video} from 'remotion';+import {AbsoluteFill, staticFile, Html5Video} from 'remotion';// ---cut---export const MyComposition = () => {return (<AbsoluteFill>- <Video src={staticFile('video.webm')} trimBefore={60} trimAfter={120} />+ <Html5Video src={staticFile('video.webm')} trimBefore={60} trimAfter={120} /></AbsoluteFill>);};@@ -98,13 +98,13 @@ This prop has been renamed to [`trimAfter`](#trimAfter) in 4.0.319. It will contYou can pass any style you can pass to a native `<video>` element. For example, set its size:```tsx twoslash-import {AbsoluteFill, staticFile, Video} from 'remotion';+import {AbsoluteFill, staticFile, Html5Video} from 'remotion';// ---cut---export const MyComposition = () => {return (<AbsoluteFill>- <Video src={staticFile('video.webm')} style={{height: 720, width: 1280}} />+ <Html5Video src={staticFile('video.webm')} style={{height: 720, width: 1280}} /></AbsoluteFill>);};@@ -115,26 +115,26 @@ export const MyComposition = () => {Allows you to control the volume for the whole track or change it on a per-frame basis. Refer to the [using audio](/docs/audio/volume) guide to learn how to use it.```tsx twoslash title="Example using static volume"-import {AbsoluteFill, staticFile, Video} from 'remotion';+import {AbsoluteFill, staticFile, Html5Video} from 'remotion';// ---cut---export const MyComposition = () => {return (<AbsoluteFill>- <Video volume={0.5} src={staticFile('video.webm')} />+ <Html5Video volume={0.5} src={staticFile('video.webm')} /></AbsoluteFill>);};``````tsx twoslash title="Example of a ramp up over 100 frames"-import {AbsoluteFill, interpolate, staticFile, Video} from 'remotion';+import {AbsoluteFill, interpolate, staticFile, Html5Video} from 'remotion';// ---cut---export const MyComposition = () => {return (<AbsoluteFill>- <Video volume={(f) => interpolate(f, [0, 100], [0, 1], {extrapolateLeft: 'clamp', extrapolateRight: 'clamp'})} src={staticFile('video.webm')} />+ <Html5Video volume={(f) => interpolate(f, [0, 100], [0, 1], {extrapolateLeft: 'clamp', extrapolateRight: 'clamp'})} src={staticFile('video.webm')} /></AbsoluteFill>);};@@ -160,13 +160,13 @@ Controls the speed of the video. `1` is the default and means regular speed, `0.While Remotion doesn't limit the range of possible playback speeds, in development mode the [`HTMLMediaElement.playbackRate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/playbackRate) API is used which throws errors on extreme values. At the time of writing, Google Chrome throws an exception if the playback rate is below `0.0625` or above `16`.```tsx twoslash title="Example of a video playing twice as fast"-import {AbsoluteFill, staticFile, Video} from 'remotion';+import {AbsoluteFill, staticFile, Html5Video} from 'remotion';// ---cut---export const MyComposition = () => {return (<AbsoluteFill>- <Video playbackRate={2} src={staticFile('video.webm')} />+ <Html5Video playbackRate={2} src={staticFile('video.webm')} /></AbsoluteFill>);};@@ -181,12 +181,12 @@ Playing a video in reverse is not supported.You can drop the audio of the video by adding a `muted` prop:```tsx twoslash title="Example of a muted video"-import {AbsoluteFill, Video} from 'remotion';+import {AbsoluteFill, Html5Video} from 'remotion';// ---cut---export const MyComposition = () => {return (<AbsoluteFill>- <Video muted src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" />+ <Html5Video muted src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" /></AbsoluteFill>);};@@ -199,12 +199,12 @@ This has the benefit that Remotion will not have to download the video file duriMakes the video loop indefinitely.```tsx twoslash title="Example of a looped video"-import {AbsoluteFill, Video} from 'remotion';+import {AbsoluteFill, Html5Video} from 'remotion';// ---cut---export const MyComposition = () => {return (<AbsoluteFill>- <Video loop src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" />+ <Html5Video loop src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" /></AbsoluteFill>);};@@ -227,13 +227,13 @@ A `toneFrequency` of 0.5 would lower the pitch by half, and a `toneFrequency` ofSelect the audio stream to use. The default is `0`.```tsx twoslash-import {AbsoluteFill, Video} from 'remotion';+import {AbsoluteFill, Html5Video} from 'remotion';// ---cut---export const MyComposition = () => {return (<AbsoluteFill>- <Video audioStreamIndex={1} src={'https://remotion.media/multiple-audio-streams.mov'} />+ <Html5Video audioStreamIndex={1} src={'https://remotion.media/multiple-audio-streams.mov'} /></AbsoluteFill>);};@@ -303,8 +303,8 @@ See: [Which video formats does Remotion support?](/docs/miscellaneous/video-form## Alternatives: `<OffthreadVideo>` and `@remotion/media`-[`<OffthreadVideo>`](/docs/offthreadvideo) is a Rust-based alternative to `<Video>`.-[`@remotion/media`](/docs/media/video) is an experimental component that will replace `<Video>` at some point.+[`<OffthreadVideo>`](/docs/offthreadvideo) is a Rust-based alternative to `<Html5Video>`.+[`@remotion/media`](/docs/media/video) is an experimental component that will replace `<Html5Video>` at some point.To decide which tag to use, see: [Comparison of video tags](/docs/video-tags)diff --git a/packages/docs/docs/lambda/troubleshooting/chrome-133-situation.mdx b/packages/docs/docs/lambda/troubleshooting/chrome-133-situation.mdxindex b547355feb..1a1a30693e 100644--- a/packages/docs/docs/lambda/troubleshooting/chrome-133-situation.mdx+++ b/packages/docs/docs/lambda/troubleshooting/chrome-133-situation.mdx@@ -18,7 +18,7 @@ You are affected if you:- are on Remotion version 4.0.274 - 4.0.288 (inclusive)- are using Remotion Lambda-- are using the [getVideoMetadata()](/docs/get-video-metadata) API from [@remotion/media-utils](/docs/media-utils) or the `<Video>` tag with an MP4 file+- are using the [getVideoMetadata()](/docs/get-video-metadata) API from [@remotion/media-utils](/docs/media-utils) or the `<Html5Video>` tag with an MP4 file## Solution@@ -27,7 +27,7 @@ Upgrade to Remotion version v4.0.289 or higher.## Workarounds- Option 1: Revert to Remotion version 4.0.273-- Option 2: Replace [getVideoMetadata()](/docs/renderer/get-video-metadata) with [parseMedia()](/docs/media-parser/parse-media) and `<Video>` with `<OffthreadVideo>` if you can. We recommend both of these in general.+- Option 2: Replace [getVideoMetadata()](/docs/renderer/get-video-metadata) with [parseMedia()](/docs/media-parser/parse-media) and `<Html5Video>` with `<OffthreadVideo>` if you can. We recommend both of these in general.## Apologiesdiff --git a/packages/docs/docs/media-fragments.mdx b/packages/docs/docs/media-fragments.mdxindex 2660ee3da7..d84fc0bcac 100644--- a/packages/docs/docs/media-fragments.mdx+++ b/packages/docs/docs/media-fragments.mdx@@ -65,8 +65,8 @@ Anytime they change, the browser considers this a new source and re-loads the viThere are valid scenarios where we recommend disabling the media fragment hints:- Changing the `from` and `durationInFrames` values of a `<Sequence>` dynamically-- Changing the `trimBefore` and `trimAfter` values of a `<Video>` or `<OffthreadVideo>` dynamically-- Changing the `playbackRate` of a `<Video>` over time.+- Changing the `trimBefore` and `trimAfter` values of a `<Html5Video>` or `<OffthreadVideo>` dynamically+- Changing the `playbackRate` of a `<Html5Video>`, `<OffthreadVideo>` or `<Video>` over time.Normally you would not do this, but there are exceptions, like: [Changing the speed of a video over time](/docs/miscellaneous/snippets/accelerated-video)diff --git a/packages/docs/docs/media-playback-error.mdx b/packages/docs/docs/media-playback-error.mdxindex 88109aedad..0ded5a1a1f 100644--- a/packages/docs/docs/media-playback-error.mdx+++ b/packages/docs/docs/media-playback-error.mdx@@ -56,13 +56,13 @@ First check that you are not accidentially creating an infite render loop. For econst uuidv4 = () => '';// ---cut----import {Video} from 'remotion';+import {Html5Video} from 'remotion';export default function SBSVideo() {return (<>{['https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4', 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4'].map((video, i) => {- return <Video key={uuidv4()} src={video} />;+ return <Html5Video key={uuidv4()} src={video} />;})}</>);@@ -73,7 +73,7 @@ If you ruled out this possibility, use [`<OffthreadVideo>`](/docs/offthreadvideo## Recover from this error<AvailableFrom v="3.3.89" />-You can handle this error and replace it with a different video by passing the `onError()` prop to the `<Video>` or `<OffthreadVideo>` component.+You can handle this error and replace it with a different video by passing the `onError()` prop to the `<Html5Video>` or `<OffthreadVideo>` component.## See alsodiff --git a/packages/docs/docs/miscellaneous/pexels.mdx b/packages/docs/docs/miscellaneous/pexels.mdxindex f6ef2fc6c2..0db7e930bd 100644--- a/packages/docs/docs/miscellaneous/pexels.mdx+++ b/packages/docs/docs/miscellaneous/pexels.mdx@@ -8,7 +8,7 @@ crumb: 'Troubleshooting'When including videos from Pexels, especially when rendering on Remotion Lambda, you may encounter the following error:```-A delayRender() 'Loading <Video> duration with src="https://videos.pexels.com/video-files/5182920/5182920-hd_720_1280_25fps.mp4"' was called but not cleared after 28000ms.+A delayRender() 'Loading <Html5Video> duration with src="https://videos.pexels.com/video-files/5182920/5182920-hd_720_1280_25fps.mp4"' was called but not cleared after 28000ms.```ordiff --git a/packages/docs/docs/miscellaneous/snippets/hls.mdx b/packages/docs/docs/miscellaneous/snippets/hls.mdxindex 17483d1d88..efd5680725 100644--- a/packages/docs/docs/miscellaneous/snippets/hls.mdx+++ b/packages/docs/docs/miscellaneous/snippets/hls.mdx@@ -34,7 +34,7 @@ for how to use different components based on whether you are rendering or previe```tsx twoslash title="HlsDemo.tsx"import Hls from 'hls.js';import React, {useEffect, useRef} from 'react';-import {AbsoluteFill, RemotionVideoProps, Video} from 'remotion';+import {AbsoluteFill, RemotionVideoProps, Html5Video} from 'remotion';const HlsVideo: React.FC<RemotionVideoProps> = ({src}) => {const videoRef = useRef<HTMLVideoElement>(null);@@ -64,7 +64,7 @@ const HlsVideo: React.FC<RemotionVideoProps> = ({src}) => {};}, [src]);- return <Video ref={videoRef} src={src} />;+ return <Html5Video ref={videoRef} src={src} />;};export const HlsDemo: React.FC = () => {diff --git a/packages/docs/docs/miscellaneous/video-formats.mdx b/packages/docs/docs/miscellaneous/video-formats.mdxindex 91b9b5a0a5..36727a47a2 100644--- a/packages/docs/docs/miscellaneous/video-formats.mdx+++ b/packages/docs/docs/miscellaneous/video-formats.mdx@@ -19,4 +19,4 @@ Codec support varies between browsers and changes from time to time. Refer to thPrior to v4.0.18, if you did not have a local copy of Chrome, Remotion would download a copy of Chromium which [would not support the proprietary H.264 and H.265 codecs](/docs/miscellaneous/chrome-headless-shell).:::-**Codecs supported for [`<OffthreadVideo>`](/docs/offthreadvideo)**: The same support that applies to `<Video>` applies to `<OffthreadVideo>` as well, however, more codecs can be supported during rendering since FFmpeg is used under the hood to read the video file. We however don't maintain an exact list of supported video codecs.+**Codecs supported for [`<OffthreadVideo>`](/docs/offthreadvideo)**: The same support that applies to `<Html5Video>` applies to `<OffthreadVideo>` as well, however, more codecs can be supported during rendering since FFmpeg is used under the hood to read the video file. We however don't maintain an exact list of supported video codecs.diff --git a/packages/docs/docs/multiple-fps.mdx b/packages/docs/docs/multiple-fps.mdxindex 15a4337b65..34779aa1b7 100644--- a/packages/docs/docs/multiple-fps.mdx+++ b/packages/docs/docs/multiple-fps.mdx@@ -106,7 +106,7 @@ export const Root: React.FC = () => {## FPS Convert is discouragedPreviously, this page showed a FPS converter snippet.-It's usage is not recommended because it does not work with media tags (`<Video>`, `<Audio>`, `<OffthreadVideo>`, etc.).+It's usage is not recommended because it does not work with media tags (`<Html5Video>`, `<Audio>`, `<OffthreadVideo>`, etc.).## See alsodiff --git a/packages/docs/docs/offthreadvideo.mdx b/packages/docs/docs/offthreadvideo.mdxindex 99c46c7884..818ad15f5e 100644--- a/packages/docs/docs/offthreadvideo.mdx+++ b/packages/docs/docs/offthreadvideo.mdx@@ -9,7 +9,7 @@ _Available from Remotion 3.0.11_This component imports and displays a video, similar to [`<Html5Video/>`](/docs/html5-video), but during rendering, extracts the exact frame from the video and displays it in a [`<Img>`](/docs/img) tag. This extraction process happens outside the browser using FFmpeg.-This component was designed to combat limitations of the default `<Video>` element. See: [Comparison of video tags](/docs/video-tags).+This component was designed to combat limitations of the default `<Html5Video>` element. See: [Comparison of video tags](/docs/video-tags).## Example@@ -325,7 +325,7 @@ You can use the following `<LoopableOffthreadVideo>` component that uses [`@remo```tsx twoslash title="src/LoopableOffthreadVideo.tsx"import {mediaParserController, parseMedia} from '@remotion/media-parser';import React, {useEffect, useState} from 'react';-import {cancelRender, continueRender, delayRender, Loop, OffthreadVideo, RemotionOffthreadVideoProps, useRemotionEnvironment, useVideoConfig, Video} from 'remotion';+import {cancelRender, continueRender, delayRender, Loop, OffthreadVideo, RemotionOffthreadVideoProps, useRemotionEnvironment, useVideoConfig, Html5Video} from 'remotion';const LoopedOffthreadVideo: React.FC<RemotionOffthreadVideoProps> = (props) => {const [duration, setDuration] = useState<number | null>(null);@@ -382,7 +382,7 @@ export const LoopableOffthreadVideo: React.FC<return <OffthreadVideo {...props} />;}- return <Video loop={loop} {...props}></Video>;+ return <Html5Video loop={loop} {...props}></Html5Video>;};```diff --git a/packages/docs/docs/player/premounting.mdx b/packages/docs/docs/player/premounting.mdxindex 5462e4ae75..a7af8a7065 100644--- a/packages/docs/docs/player/premounting.mdx+++ b/packages/docs/docs/player/premounting.mdx@@ -40,13 +40,13 @@ Add the [`premountFor`](/docs/sequence#premountfor) prop to the [`<Sequence>`](/The number you pass is the number in frames you premount the component for.```tsx twoslash title="Premounted.tsx"-import {Sequence, staticFile, Video} from 'remotion';+import {Sequence, staticFile, OffthreadVideo} from 'remotion';// ---cut---const MyComp: React.FC = () => {return (<Sequence premountFor={100}>- <Video src={staticFile('bigbuckbunny.mp4')}></Video>+ <OffthreadVideo src={staticFile('bigbuckbunny.mp4')}></OffthreadVideo></Sequence>);};diff --git a/packages/docs/docs/preload/preload-video.mdx b/packages/docs/docs/preload/preload-video.mdxindex 0da485066e..376cd58a93 100644--- a/packages/docs/docs/preload/preload-video.mdx+++ b/packages/docs/docs/preload/preload-video.mdx@@ -3,8 +3,8 @@ image: /generated/articles-docs-preload-preload-video.pngid: preload-videoslug: preload-videosidebar_label: preloadVideo()-title: "preloadVideo()"-crumb: "@remotion/player"+title: 'preloadVideo()'+crumb: '@remotion/player'---_This function is part of the [`@remotion/preload`](/docs/preload) package._@@ -18,11 +18,9 @@ An alternative to `preloadVideo()` is the [`prefetch()`](/docs/prefetch) API. Se## Usage```tsx twoslash-import { preloadVideo } from "@remotion/preload";+import {preloadVideo} from '@remotion/preload';-const unpreload = preloadVideo(- "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"-);+const unpreload = preloadVideo('http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4');// If you want to un-preload the video laterunpreload();@@ -44,12 +42,11 @@ If the resource does not support CORS, `resolveRedirect()` will fail. If the resThis snippet tries to preload a video on a best-effort basis. If the redirect cannot be resolved, it tries to preload the original URL.```tsx twoslash-import { preloadVideo, resolveRedirect } from "@remotion/preload";-import { Video } from "remotion";+import {preloadVideo, resolveRedirect} from '@remotion/preload';+import {OffthreadVideo} from 'remotion';// This code gets executed immediately once the page loads-let urlToLoad =- "https://player.vimeo.com/external/291648067.hd.mp4?s=94998971682c6a3267e4cbd19d16a7b6c720f345&profile_id=175&oauth2_token_id=57447761";+let urlToLoad = 'https://player.vimeo.com/external/291648067.hd.mp4?s=94998971682c6a3267e4cbd19d16a7b6c720f345&profile_id=175&oauth2_token_id=57447761';resolveRedirect(urlToLoad).then((resolved) => {@@ -58,7 +55,7 @@ resolveRedirect(urlToLoad)}).catch((err) => {// Was unable to resolve redirect e.g. due to no CORS support- console.log("Could not resolve redirect", err);+ console.log('Could not resolve redirect', err);}).finally(() => {// In either case, we try to preload the original or resolved URL@@ -71,7 +68,7 @@ const MyComp: React.FC = () => {// If the component mounted immediately, this will be the original URL.// In that case preloading is ineffective anyway.- return <Video src={urlToLoad}></Video>;+ return <OffthreadVideo src={urlToLoad}></OffthreadVideo>;};```diff --git a/packages/docs/docs/preload/resolve-redirect.mdx b/packages/docs/docs/preload/resolve-redirect.mdxindex ac22317c0d..f17a21704f 100644--- a/packages/docs/docs/preload/resolve-redirect.mdx+++ b/packages/docs/docs/preload/resolve-redirect.mdx@@ -1,7 +1,7 @@---id: resolve-redirecttitle: resolveRedirect()-crumb: "@remotion/player"+crumb: '@remotion/player'---Follows the redirects of a URL (most commonly a remote video or audio) until the final URL is resolved and returns that.@@ -9,16 +9,14 @@ Follows the redirects of a URL (most commonly a remote video or audio) until theIf the resource does not support CORS, the function will throw. **If the resource redirects, and does not support CORS, you cannot preload the asset.**```tsx twoslash-import { resolveRedirect } from "@remotion/preload";+import {resolveRedirect} from '@remotion/preload';-resolveRedirect(- "https://player.vimeo.com/external/291648067.hd.mp4?s=94998971682c6a3267e4cbd19d16a7b6c720f345&profile_id=175&oauth2_token_id=57447761"-)+resolveRedirect('https://player.vimeo.com/external/291648067.hd.mp4?s=94998971682c6a3267e4cbd19d16a7b6c720f345&profile_id=175&oauth2_token_id=57447761').then((src) => {console.log(src); // "https://vod-progressive.akamaized.net/..."}).catch((err) => {- console.log("Could not resolve redirect", err);+ console.log('Could not resolve redirect', err);});```@@ -27,12 +25,11 @@ resolveRedirect(This snippet tries to preload a video on a best-effort basis. If the redirect cannot be resolved, it tries to preload the original URL.```tsx twoslash-import { preloadVideo, resolveRedirect } from "@remotion/preload";-import { Video } from "remotion";+import {preloadVideo, resolveRedirect} from '@remotion/preload';+import {OffthreadVideo} from 'remotion';// This code gets executed immediately once the page loads-let urlToLoad =- "https://player.vimeo.com/external/291648067.hd.mp4?s=94998971682c6a3267e4cbd19d16a7b6c720f345&profile_id=175&oauth2_token_id=57447761";+let urlToLoad = 'https://player.vimeo.com/external/291648067.hd.mp4?s=94998971682c6a3267e4cbd19d16a7b6c720f345&profile_id=175&oauth2_token_id=57447761';resolveRedirect(urlToLoad).then((resolved) => {@@ -41,7 +38,7 @@ resolveRedirect(urlToLoad)}).catch((err) => {// Was unable to resolve redirect e.g. due to no CORS support- console.log("Could not resolve redirect", err);+ console.log('Could not resolve redirect', err);}).finally(() => {// In either case, we try to preload the original or resolved URL@@ -54,7 +51,7 @@ const MyComp: React.FC = () => {// If the component mounted immediately, this will be the original URL.// In that case preloading is ineffective anyway.- return <Video src={urlToLoad}></Video>;+ return <OffthreadVideo src={urlToLoad}></OffthreadVideo>;};```diff --git a/packages/docs/docs/remotion/table-of-contents.tsx b/packages/docs/docs/remotion/table-of-contents.tsxindex b4b2fe905e..3b5dc96164 100644--- a/packages/docs/docs/remotion/table-of-contents.tsx+++ b/packages/docs/docs/remotion/table-of-contents.tsx@@ -73,7 +73,7 @@ export const TableOfContents: React.FC = () => {<TOCItem link="/docs/offthreadvideo"><strong>{'<OffthreadVideo>'}</strong><div>- Alternative to <code>{'<Video>'}</code>+ Alternative to <code>{'<Html5Video>'}</code></div></TOCItem><TOCItem link="/docs/animatedimage">diff --git a/packages/docs/docs/renderer/get-video-metadata.mdx b/packages/docs/docs/renderer/get-video-metadata.mdxindex fb323920ea..dc73f427c1 100644--- a/packages/docs/docs/renderer/get-video-metadata.mdx+++ b/packages/docs/docs/renderer/get-video-metadata.mdx@@ -96,7 +96,7 @@ A prediction whether the video will be seekable in the browser. The algorithm is5. Otherwise, it is not seekable (`false`).If a video is not seekable, you might run into the ["Non-seekable media"](/docs/non-seekable-media) error.-This means that the video might fail to render if embedded in a `<Video>` tag and be slow if embedded in a `<OffthreadVideo>` tag.+This means that the video might fail to render if embedded in a `<Html5Video>` tag and be slow if embedded in a `<OffthreadVideo>` tag.You may consider re-encoding the video using FFmpeg to make it seekable.diff --git a/packages/docs/docs/studio/get-static-files.mdx b/packages/docs/docs/studio/get-static-files.mdxindex 3e8b66e7d0..358b21a0ce 100644--- a/packages/docs/docs/studio/get-static-files.mdx+++ b/packages/docs/docs/studio/get-static-files.mdx@@ -1,7 +1,7 @@---image: /generated/articles-docs-studio-get-static-files.pngtitle: getStaticFiles()-crumb: "@remotion/studio"+crumb: '@remotion/studio'---# getStaticFiles()<AvailableFrom v="4.0.144"/>@@ -22,8 +22,8 @@ On Linux, watching for changes in subdirectories is only supported from Node.js:::```tsx twoslash title="example.ts"-import { getStaticFiles, StaticFile } from "@remotion/studio";-import { Video } from "remotion";+import {getStaticFiles, StaticFile} from '@remotion/studio';+import {Video} from '@remotion/media';const files = getStaticFiles();/*@@ -51,7 +51,7 @@ const videoSrc = files[0].src;// Find a file by it's name and import itconst data = files.find((f) => {- return f.name === "video.mp4";+ return f.name === 'video.mp4';}) as StaticFile; // Use `as StaticFile` to assert the file exists// Use the `src` property to get a src to pass to a media elementdiff --git a/packages/docs/docs/timeout.mdx b/packages/docs/docs/timeout.mdxindex 42ab4aa5c6..de91f0b314 100644--- a/packages/docs/docs/timeout.mdx+++ b/packages/docs/docs/timeout.mdx@@ -30,7 +30,7 @@ If you rely on network assets such as fonts, images, videos or audio and you don### Memory pressure-When setting the concurrency too high, Chrome might decide to not load some `<Video />`s which can lead to a timeout error.+When setting the concurrency too high, Chrome might decide to not load some `<Html5Video />`s which can lead to a timeout error.We consider this a bug in Remotion and plan to fix it in the future.diff --git a/packages/docs/docs/use-offthread-video-texture.mdx b/packages/docs/docs/use-offthread-video-texture.mdxindex 931f97babd..ef5f3ea94e 100644--- a/packages/docs/docs/use-offthread-video-texture.mdx+++ b/packages/docs/docs/use-offthread-video-texture.mdx@@ -11,7 +11,7 @@ Allows you to use a video in React Three Fiber that is synchronized with RemotioThis hook only works during rendering. In the Player and the Remotion Studio, use [`useVideoTexture()`](/docs/use-video-texture) instead. See below for an example.-This hook was designed to combat limitations of the default `<Video>` element that is used with `useVideoTexture()` hook.+This hook was designed to combat limitations of the default `<Html5Video>` element that is used with `useVideoTexture()` hook.See: [Comparison of video tags](/docs/video-tags)The return type of it is a `THREE.Texture | null` which you can assign as a `map` to for example `meshBasicMaterial`. We recommend to only render the material when the texture is not `null` to prevent bugs.@@ -40,7 +40,7 @@ const My3DVideo = () => {```tsx twoslash title="Use useVideoTexture() only during rendering"import {ThreeCanvas, useOffthreadVideoTexture, useVideoTexture} from '@remotion/three';import {useRef} from 'react';-import {staticFile, useRemotionEnvironment, useVideoConfig, Video} from 'remotion';+import {staticFile, useRemotionEnvironment, useVideoConfig, Html5Video} from 'remotion';const videoSrc = staticFile('/vid.mp4');@@ -64,7 +64,7 @@ const My3DVideo = () => {return (<>- {env.isRendering ? null : <Video ref={videoRef} src={videoSrc} style={{position: 'absolute', opacity: 0}} />}+ {env.isRendering ? null : <Html5Video ref={videoRef} src={videoSrc} style={{position: 'absolute', opacity: 0}} />}<ThreeCanvas width={width} height={height}><mesh>{videoTexture ? <meshBasicMaterial map={videoTexture} /> : null}</mesh></ThreeCanvas>diff --git a/packages/docs/docs/use-video-texture.mdx b/packages/docs/docs/use-video-texture.mdxindex 4ff506cff8..d03a9b7219 100644--- a/packages/docs/docs/use-video-texture.mdx+++ b/packages/docs/docs/use-video-texture.mdx@@ -2,7 +2,7 @@image: /generated/articles-docs-use-video-texture.pngid: use-video-texturetitle: useVideoTexture()-crumb: "@remotion/three"+crumb: '@remotion/three'---Allows you to use a video in React Three Fiber that is synchronized with Remotion's `useCurrentFrame()`.@@ -10,30 +10,23 @@ Allows you to use a video in React Three Fiber that is synchronized with RemotioTo use a video in a Three.JS context, you first have to render it and assign it a ref. If you only want to use it in a React Three Fiber Scene, you can make it invisible by adding a `{position: "absolute", opacity: 0}` style.```tsx twoslash-import { useRef } from "react";-import { Video } from "remotion";-import src from "./vid.mp4";+import {useRef} from 'react';+import {Html5Video} from 'remotion';+import src from './vid.mp4';const MyVideo = () => {const videoRef = useRef<HTMLVideoElement | null>(null);- return (- <Video- ref={videoRef}- src={src}- style={{ position: "absolute", opacity: 0 }}- />- );+ return <Html5Video ref={videoRef} src={src} style={{position: 'absolute', opacity: 0}} />;};```To convert the video to a video texture, place the `useVideoTexture()` hook in the same component.```tsx twoslash-const videoRef: React.MutableRefObject<HTMLVideoElement | null> =- React.useRef(null);+const videoRef: React.MutableRefObject<HTMLVideoElement | null> = React.useRef(null);// ---cut----import { useVideoTexture } from "@remotion/three";+import {useVideoTexture} from '@remotion/three';// ...@@ -43,9 +36,8 @@ const texture = useVideoTexture(videoRef);The return type of it is a `THREE.VideoTexture | null` which you can assign as a `map` to for example `meshBasicMaterial`. We recommend to only render the material when the texture is not `null` to prevent bugs.```tsx twoslash-import { useVideoTexture } from "@remotion/three";-const videoRef: React.MutableRefObject<HTMLVideoElement | null> =- React.useRef(null);+import {useVideoTexture} from '@remotion/three';+const videoRef: React.MutableRefObject<HTMLVideoElement | null> = React.useRef(null);const videoTexture = useVideoTexture(videoRef);// ---cut---{diff --git a/packages/docs/docs/video-manipulation.mdx b/packages/docs/docs/video-manipulation.mdxindex c801d3cf70..260cd507ca 100644--- a/packages/docs/docs/video-manipulation.mdx+++ b/packages/docs/docs/video-manipulation.mdx@@ -151,5 +151,5 @@ export const Greenscreen: React.FC<{## Before v4.0.190Before v4.0.190, the `onVideoFrame` prop of [`<OffthreadVideo>`](/docs/offthreadvideo) and [`<Html5Video>`](/docs/html5-video) was not supported.-You could only manipulate a `<Video>` using the `requestVideoFrameCallback` API.+You could only manipulate a `<Html5Video>` using the `requestVideoFrameCallback` API.Click [here](https://github.com/remotion-dev/remotion/blob/b966d0e99cfb91478ca697675f822284da1f9055/packages/docs/docs/video-manipulation.mdx) to see the old version of this page.diff --git a/packages/docs/src/data/articles.ts b/packages/docs/src/data/articles.tsindex 8f2abb2da1..277d0f4eaa 100644--- a/packages/docs/src/data/articles.ts+++ b/packages/docs/src/data/articles.ts@@ -251,15 +251,6 @@ export const articles = [noAi: false,slug: 'ask-in-public',},- {- id: 'audio',- title: '<Audio>',- relativePath: 'docs/audio.mdx',- compId: 'articles-docs-audio',- crumb: 'API - remotion',- noAi: false,- slug: 'audio',- },{id: 'delaying',title: 'Delaying Audio',@@ -386,15 +377,6 @@ export const articles = [noAi: false,slug: 'brownfield',},- {- id: 'buffer-state',- title: 'Display a buffer state',- relativePath: 'docs/buffer-state.mdx',- compId: 'articles-docs-buffer-state',- crumb: 'Building video apps',- noAi: false,- slug: 'buffer-state',- },{id: 'building-a-timeline',title: 'Build a timeline-based video editor',@@ -1790,6 +1772,24 @@ export const articles = [noAi: false,slug: 'props-resolution',},+ {+ id: 'html5-audio',+ title: '<Html5Audio>',+ relativePath: 'docs/html5-audio.mdx',+ compId: 'articles-docs-html5-audio',+ crumb: 'API - remotion',+ noAi: false,+ slug: 'html5-audio',+ },+ {+ id: 'html5-video',+ title: '<Html5Video>',+ relativePath: 'docs/html5-video.mdx',+ compId: 'articles-docs-html5-video',+ crumb: 'API - remotion',+ noAi: false,+ slug: 'html5-video',+ },{id: 'iframe',title: '<IFrame>',@@ -3295,7 +3295,7 @@ export const articles = [},{id: 'media/fallback',- title: 'Fallback from @remotion/media to <OffthreadVideo> or <Audio>',+ title: 'Fallback from @remotion/media to <OffthreadVideo> or <Html5Audio>',relativePath: 'docs/media/fallback.mdx',compId: 'articles-docs-media-fallback',crumb: '@remotion/media',@@ -6232,15 +6232,6 @@ export const articles = [noAi: false,slug: 'video-uploads',},- {- id: 'video',- title: '<Video>',- relativePath: 'docs/video.mdx',- compId: 'articles-docs-video',- crumb: 'API - remotion',- noAi: false,- slug: 'video',- },{id: 'videos/index',title: 'Embedding videos into Remotion',diff --git a/packages/docs/static/generated/articles-docs-html5-audio.png b/packages/docs/static/generated/articles-docs-html5-audio.pngnew file mode 100644index 0000000000..fbbc1b211fBinary files /dev/null and b/packages/docs/static/generated/articles-docs-html5-audio.png differdiff --git a/packages/docs/static/generated/articles-docs-html5-video.png b/packages/docs/static/generated/articles-docs-html5-video.pngnew file mode 100644index 0000000000..a861a9561dBinary files /dev/null and b/packages/docs/static/generated/articles-docs-html5-video.png differdiff --git a/packages/eslint-plugin/src/tests/volume-callback.test.ts b/packages/eslint-plugin/src/tests/volume-callback.test.tsindex d37651f76f..0bda363888 100644--- a/packages/eslint-plugin/src/tests/volume-callback.test.ts+++ b/packages/eslint-plugin/src/tests/volume-callback.test.ts@@ -13,17 +13,26 @@ const ruleTester = new ESLintUtils.RuleTester({ruleTester.run('volume-callback', rule, {valid: [`-import {Video} from 'remotion';+import {Html5Video} from 'remotion';export const Re = () => {return (- <Video volume={1} />+ <Html5Video volume={1} />);}`,`import {Video} from 'remotion';+export const Re = () => {+ return (+ <Video volume={f => f / 29} />+ );+}+ `,+ `+import {Video} from '@remotion/media';+export const Re = () => {return (<Video volume={f => f / 29} />diff --git a/packages/example/src/AudioTestingMute/index.tsx b/packages/example/src/AudioTestingMute/index.tsxindex 97780f0087..82e9e95809 100644--- a/packages/example/src/AudioTestingMute/index.tsx+++ b/packages/example/src/AudioTestingMute/index.tsx@@ -1,10 +1,10 @@import React from 'react';import {Html5Audio,+ Html5Video,Sequence,useCurrentFrame,useVideoConfig,- Video,} from 'remotion';import movie from '../resources/framer-music.mp4';import music from '../resources/sound1.mp3';@@ -33,7 +33,7 @@ const AudioTestingMute: React.FC = () => {return (<div>- <Video src={movie} muted={getMuteState('movie')} />+ <Html5Video src={movie} muted={getMuteState('movie')} /><Sequence from={20} durationInFrames={200}><Sequence from={20} durationInFrames={200}><Sequence from={20} durationInFrames={200}>diff --git a/packages/example/src/BufferState/Video.tsx b/packages/example/src/BufferState/Video.tsxindex 6e29fda6c3..9ca991e3fb 100644--- a/packages/example/src/BufferState/Video.tsx+++ b/packages/example/src/BufferState/Video.tsx@@ -1,9 +1,9 @@import React from 'react';-import {AbsoluteFill, Series, Video} from 'remotion';+import {AbsoluteFill, Html5Video, Series} from 'remotion';const Inside: React.FC = () => {return (- <Video+ <Html5VideopauseWhenBufferingsrc="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"/>diff --git a/packages/example/src/Freeze/FreezeExample.tsx b/packages/example/src/Freeze/FreezeExample.tsxindex 4343dbef25..f503feb70a 100644--- a/packages/example/src/Freeze/FreezeExample.tsx+++ b/packages/example/src/Freeze/FreezeExample.tsx@@ -1,5 +1,5 @@import React, {useRef} from 'react';-import {Freeze, Series, staticFile, Video} from 'remotion';+import {Freeze, Html5Video, Series, staticFile} from 'remotion';export const FreezeExample: React.FC = () => {const video = staticFile('framermp4withoutfileextension');@@ -9,15 +9,15 @@ export const FreezeExample: React.FC = () => {<Series><Series.Sequence durationInFrames={25}><Freeze frame={0}>- <Video src={video} />+ <Html5Video src={video} /></Freeze></Series.Sequence><Series.Sequence ref={ref} durationInFrames={50}>- <Video src={video} />+ <Html5Video src={video} /></Series.Sequence><Series.Sequence durationInFrames={50}><Freeze active={(f) => f >= 30} frame={30}>- <Video src={video} />+ <Html5Video src={video} /></Freeze></Series.Sequence></Series>diff --git a/packages/example/src/Hls/HlsDemo.tsx b/packages/example/src/Hls/HlsDemo.tsxindex 4177a0a23b..76c2927ae4 100644--- a/packages/example/src/Hls/HlsDemo.tsx+++ b/packages/example/src/Hls/HlsDemo.tsx@@ -1,6 +1,6 @@import Hls from 'hls.js';import React, {useEffect, useRef} from 'react';-import {AbsoluteFill, RemotionVideoProps, Video} from 'remotion';+import {AbsoluteFill, Html5Video, RemotionVideoProps} from 'remotion';const HlsVideo: React.FC<RemotionVideoProps> = ({src}) => {const videoRef = useRef<HTMLVideoElement>(null);@@ -20,7 +20,7 @@ const HlsVideo: React.FC<RemotionVideoProps> = ({src}) => {};}, [src]);- return <Video ref={videoRef} src={src} />;+ return <Html5Video ref={videoRef} src={src} />;};export const HlsDemo: React.FC = () => {diff --git a/packages/example/src/LoopedOffthreadVideo.tsx b/packages/example/src/LoopedOffthreadVideo.tsxindex 5c0e1ee66e..636374a48b 100644--- a/packages/example/src/LoopedOffthreadVideo.tsx+++ b/packages/example/src/LoopedOffthreadVideo.tsx@@ -4,12 +4,12 @@ import {cancelRender,continueRender,delayRender,+ Html5Video,Loop,OffthreadVideo,RemotionOffthreadVideoProps,useRemotionEnvironment,useVideoConfig,- Video,} from 'remotion';const LoopedOffthreadVideo: React.FC<RemotionOffthreadVideoProps> = (props) => {@@ -67,5 +67,5 @@ export const LoopableOffthreadVideo: React.FC<return <OffthreadVideo {...props} />;}- return <Video loop={loop} {...props}></Video>;+ return <Html5Video loop={loop} {...props}></Html5Video>;};diff --git a/packages/example/src/Postmount/PostmountExample.tsx b/packages/example/src/Postmount/PostmountExample.tsxindex 012e44e89b..11dff77b7a 100644--- a/packages/example/src/Postmount/PostmountExample.tsx+++ b/packages/example/src/Postmount/PostmountExample.tsx@@ -1,5 +1,5 @@import React from 'react';-import {AbsoluteFill, Series, staticFile, Video} from 'remotion';+import {AbsoluteFill, Html5Video, Series, staticFile} from 'remotion';export const PostmountExample: React.FC = () => {return (@@ -11,12 +11,12 @@ export const PostmountExample: React.FC = () => {premountFor={20}postmountFor={30}>- <Video pauseWhenBuffering src={staticFile('framer.webm')} />+ <Html5Video pauseWhenBuffering src={staticFile('framer.webm')} /></Series.Sequence>{/* Second video with just postmount to keep it in memory */}<Series.Sequence durationInFrames={150} postmountFor={50}>- <Video+ <Html5VideopauseWhenBufferingsrc="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"/>@@ -28,7 +28,7 @@ export const PostmountExample: React.FC = () => {premountFor={25}postmountFor={25}>- <Video pauseWhenBuffering src={staticFile('framer.webm')} />+ <Html5Video pauseWhenBuffering src={staticFile('framer.webm')} /></Series.Sequence></Series></AbsoluteFill>diff --git a/packages/example/src/Postmount/index.tsx b/packages/example/src/Postmount/index.tsxindex e47ae9349f..b57e06bf15 100644--- a/packages/example/src/Postmount/index.tsx+++ b/packages/example/src/Postmount/index.tsx@@ -1,5 +1,5 @@import React from 'react';-import {AbsoluteFill, Sequence, Video, staticFile} from 'remotion';+import {AbsoluteFill, Html5Video, Sequence, staticFile} from 'remotion';/*** Example demonstrating postmountFor feature@@ -12,7 +12,7 @@ export const PostmountDemoComposition: React.FC = () => {<AbsoluteFill>{/* Video that stays mounted 40 frames after it ends */}<Sequence from={50} durationInFrames={100} postmountFor={40}>- <Video pauseWhenBuffering src={staticFile('framer.webm')} />+ <Html5Video pauseWhenBuffering src={staticFile('framer.webm')} /></Sequence>{/* Overlapping sequences with both premount and postmount */}@@ -23,7 +23,7 @@ export const PostmountDemoComposition: React.FC = () => {postmountFor={30}><AbsoluteFill style={{background: 'rgba(255, 0, 0, 0.5)'}}>- <Video+ <Html5VideopauseWhenBufferingsrc="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"/>@@ -38,7 +38,7 @@ export const PostmountDemoComposition: React.FC = () => {postmountFor={50}><AbsoluteFill style={{background: 'rgba(0, 0, 255, 0.5)'}}>- <Video pauseWhenBuffering src={staticFile('framer.webm')} />+ <Html5Video pauseWhenBuffering src={staticFile('framer.webm')} /></AbsoluteFill></Sequence></AbsoluteFill>diff --git a/packages/example/src/Premount/RemoteVideos.tsx b/packages/example/src/Premount/RemoteVideos.tsxindex a6bfe460d4..2d1f4f9388 100644--- a/packages/example/src/Premount/RemoteVideos.tsx+++ b/packages/example/src/Premount/RemoteVideos.tsx@@ -1,15 +1,15 @@import React from 'react';-import {AbsoluteFill, Series, staticFile, Video} from 'remotion';+import {AbsoluteFill, Html5Video, Series, staticFile} from 'remotion';export const PremountedRemoteVideos: React.FC = () => {return (<AbsoluteFill><Series><Series.Sequence durationInFrames={200} premountFor={20}>- <Video pauseWhenBuffering src={staticFile('framer.webm')} />+ <Html5Video pauseWhenBuffering src={staticFile('framer.webm')} /></Series.Sequence><Series.Sequence durationInFrames={700} premountFor={30}>- <Video+ <Html5VideopauseWhenBufferingstartFrom={1000}src="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"diff --git a/packages/example/src/Premount/index.tsx b/packages/example/src/Premount/index.tsxindex 7485d0764f..6e482f235d 100644--- a/packages/example/src/Premount/index.tsx+++ b/packages/example/src/Premount/index.tsx@@ -1,8 +1,8 @@import React from 'react';-import {AbsoluteFill, Sequence, staticFile, Video} from 'remotion';+import {AbsoluteFill, Html5Video, Sequence, staticFile} from 'remotion';const ShouldNotUnmount: React.FC = () => {- return <Video pauseWhenBuffering src={staticFile('framer.webm')} />;+ return <Html5Video pauseWhenBuffering src={staticFile('framer.webm')} />;};export const PremountedExample: React.FC = () => {diff --git a/packages/example/src/PremountOnTransitionSeries.tsx b/packages/example/src/PremountOnTransitionSeries.tsxindex 923d41c8cf..5b6f1ee3e4 100644--- a/packages/example/src/PremountOnTransitionSeries.tsx+++ b/packages/example/src/PremountOnTransitionSeries.tsx@@ -1,5 +1,5 @@import {TransitionSeries} from '@remotion/transitions';-import {Sequence, Video} from 'remotion';+import {Html5Video, Sequence} from 'remotion';// test case: Nested sequences should be considered premountedexport const PremountOnTransitionSeries = () => {@@ -11,7 +11,7 @@ export const PremountOnTransitionSeries = () => {<TransitionSeries.Sequence durationInFrames={100} premountFor={150}><Sequence><Sequence>- <Video src="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" />+ <Html5Video src="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" /></Sequence></Sequence></TransitionSeries.Sequence>diff --git a/packages/example/src/ReallyLongVideo.tsx b/packages/example/src/ReallyLongVideo.tsxindex 84be7ff830..82e435fda4 100644--- a/packages/example/src/ReallyLongVideo.tsx+++ b/packages/example/src/ReallyLongVideo.tsx@@ -1,9 +1,9 @@-import {interpolate, Loop, Video} from 'remotion';+import {Html5Video, interpolate, Loop} from 'remotion';const InfinityVideo: React.FC = () => {return (<Loop durationInFrames={10 * 30 * 60}>- <Video+ <Html5Videovolume={(f) =>interpolate(f, [0, 500], [1, 0], {extrapolateRight: 'clamp'})}diff --git a/packages/example/src/RemoteVideo/index.tsx b/packages/example/src/RemoteVideo/index.tsxindex 6ed00fd38a..6e90a470fd 100644--- a/packages/example/src/RemoteVideo/index.tsx+++ b/packages/example/src/RemoteVideo/index.tsx@@ -1,8 +1,8 @@-import {interpolate, Video} from 'remotion';+import {Html5Video, interpolate} from 'remotion';const RemoteVideo: React.FC = () => {return (- <Video+ <Html5Videovolume={(f) =>interpolate(f, [0, 500], [1, 0], {extrapolateRight: 'clamp'})}diff --git a/packages/example/src/ThreeScene/Scene.tsx b/packages/example/src/ThreeScene/Scene.tsxindex d42b1deca3..0f8260bb9b 100644--- a/packages/example/src/ThreeScene/Scene.tsx+++ b/packages/example/src/ThreeScene/Scene.tsx@@ -8,10 +8,10 @@ import {zColor} from '@remotion/zod-types';import React, {useEffect, useRef, useState} from 'react';import {AbsoluteFill,+ Html5Video,staticFile,useRemotionEnvironment,useVideoConfig,- Video,} from 'remotion';import {z} from 'zod';import {Phone} from './Phone';@@ -82,7 +82,7 @@ export const VideoTextureDemo: React.FC<return (<AbsoluteFill style={container}>{env.isRendering ? null : (- <Video ref={videoRef} src={videoSrc} style={videoStyle} />+ <Html5Video ref={videoRef} src={videoSrc} style={videoStyle} />)}{videoData ? (<ThreeCanvas linear width={width} height={height}>diff --git a/packages/example/src/VideoOnCanvas/index.tsx b/packages/example/src/VideoOnCanvas/index.tsxindex d622d74138..239f25ce67 100644--- a/packages/example/src/VideoOnCanvas/index.tsx+++ b/packages/example/src/VideoOnCanvas/index.tsx@@ -1,5 +1,5 @@import React, {useCallback, useEffect, useRef} from 'react';-import {AbsoluteFill, Video, useVideoConfig} from 'remotion';+import {AbsoluteFill, Html5Video, useVideoConfig} from 'remotion';export const VideoOnCanvas: React.FC = () => {const video = useRef<HTMLVideoElement>(null);@@ -37,10 +37,10 @@ export const VideoOnCanvas: React.FC = () => {return (<AbsoluteFill><AbsoluteFill>- <Video+ <Html5Videoref={video}style={{opacity: 0}}- startFrom={300}+ trimBefore={300}src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"/></AbsoluteFill>diff --git a/packages/example/src/VideoSpeed/index.tsx b/packages/example/src/VideoSpeed/index.tsxindex 1f6226fbfd..04948348a7 100644--- a/packages/example/src/VideoSpeed/index.tsx+++ b/packages/example/src/VideoSpeed/index.tsx@@ -1,5 +1,5 @@import React from 'react';-import {Video} from 'remotion';+import {Html5Video} from 'remotion';import framer from '../resources/framer-music.mp4';export const VideoSpeed: React.FC = () => {@@ -12,7 +12,7 @@ export const VideoSpeed: React.FC = () => {flex: 1,}}>- <Video src={framer} playbackRate={2} startFrom={20} />+ <Html5Video src={framer} playbackRate={2} startFrom={20} /></div>);};diff --git a/packages/it-tests/src/rendering/frame-accuracy-gif.test.ts b/packages/it-tests/src/rendering/frame-accuracy-gif.test.tsindex 47608d8449..6f3dbb61a4 100644--- a/packages/it-tests/src/rendering/frame-accuracy-gif.test.ts+++ b/packages/it-tests/src/rendering/frame-accuracy-gif.test.ts@@ -17,7 +17,7 @@ const getMissedFramesforCodec = async () => {);const outputPath = path.join(outputDir, 'vid.gif');- // render the VideoTesting example (which contains the Framer composition embedded with <Video>) to an image+ // render the VideoTesting example (which contains the Framer composition embedded with <Html5Video>) to an image// sequence which can be checked for accuracyawait execa('pnpm',diff --git a/packages/media/src/video/video-for-preview.tsx b/packages/media/src/video/video-for-preview.tsxindex 80df4c0f9e..6f58999a7d 100644--- a/packages/media/src/video/video-for-preview.tsx+++ b/packages/media/src/video/video-for-preview.tsx@@ -1,6 +1,6 @@import React, {useContext, useEffect, useMemo, useRef, useState} from 'react';import type {LogLevel, LoopVolumeCurveBehavior, VolumeProp} from 'remotion';-import {Internals, useBufferState, useCurrentFrame, Video} from 'remotion';+import {Html5Video, Internals, useBufferState, useCurrentFrame} from 'remotion';import {useLoopDisplay} from '../show-in-timeline';import {useMediaInTimeline} from '../use-media-in-timeline';import {MediaPlayer} from './media-player';@@ -393,7 +393,7 @@ export const VideoForPreview: React.FC<NewVideoForPreviewProps> = ({// <Video> will fallback to <VideoForPreview> anyway// not using <OffthreadVideo> because it does not support loopingreturn (- <Video+ <Html5Videosrc={src}style={style}className={className}diff --git a/packages/player-example/src/CarSlideshow.tsx b/packages/player-example/src/CarSlideshow.tsxindex 2298d12338..094e9dba85 100644--- a/packages/player-example/src/CarSlideshow.tsx+++ b/packages/player-example/src/CarSlideshow.tsx@@ -1,8 +1,8 @@import {createRef, useCallback, useImperativeHandle, useState} from 'react';import {+ Html5Video,Img,Sequence,- Video,interpolate,staticFile,useCurrentFrame,@@ -75,7 +75,7 @@ const CarSlideshow = ({title, bgColor, color}: Props) => {}}/><Sequence from={10}>- <Video+ <Html5Videostyle={{height: 200,}}diff --git a/packages/player-example/src/VideoAutoplay.tsx b/packages/player-example/src/VideoAutoplay.tsxindex 4641a12073..82afc40f3e 100644--- a/packages/player-example/src/VideoAutoplay.tsx+++ b/packages/player-example/src/VideoAutoplay.tsx@@ -2,9 +2,9 @@ import {preloadAudio, preloadVideo} from '@remotion/preload';import {AbsoluteFill,Html5Audio,+ Html5Video,Sequence,Series,- Video,staticFile,} from 'remotion';@@ -30,7 +30,7 @@ export const VideoautoplayDemo = () => {</Series.Sequence></Series><AbsoluteFill>- <Video+ <Html5VideopauseWhenBufferingsrc="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"/>diff --git a/packages/renderer/src/render-frames.ts b/packages/renderer/src/render-frames.tsindex 9f0a073ce7..bcde3cbe82 100644--- a/packages/renderer/src/render-frames.ts+++ b/packages/renderer/src/render-frames.ts@@ -344,7 +344,7 @@ const innerRenderFrames = async ({// Render the extra frames at the beginning of the video first,// then the regular frames, then the extra frames at the end of the video.- // While the order technically doesn't matter, components such as <Video> are+ // While the order technically doesn't matter, components such as <Html5Video> are// not always frame perfect and give a flicker.// We reduce the chance of flicker by rendering the frames in order.diff --git a/packages/template-three/src/Scene.tsx b/packages/template-three/src/Scene.tsxindex 1ef634d8ec..4c7ca5460d 100644--- a/packages/template-three/src/Scene.tsx+++ b/packages/template-three/src/Scene.tsx@@ -1,4 +1,4 @@-import { staticFile } from "remotion";+import { Html5Video, staticFile } from "remotion";import { getVideoMetadata, VideoMetadata } from "@remotion/media-utils";import { ThreeCanvas } from "@remotion/three";import React, { useEffect, useRef, useState } from "react";@@ -46,7 +46,7 @@ export const Scene: React.FC<return (<AbsoluteFill style={container}>- <Video+ <Html5Videoref={videoRef}src={videoSrc}style={videoStyle}