Skip to content

🎥 Make videos programmatically with React

premount docs

Jonny Burger40e82eeefb77
diff --git a/packages/docs/docs/player/premounting.mdx b/packages/docs/docs/player/premounting.mdx
index 62a667c0eb..111ed672cf 100644
--- a/packages/docs/docs/player/premounting.mdx
+++ b/packages/docs/docs/player/premounting.mdx
@@ -1,4 +1,5 @@
---
+image: /generated/articles-docs-player-premounting.png
title: Premounting
slug: /player/premounting
crumb: "@remotion/player"
@@ -35,6 +36,12 @@ Premounting is the practice of mounting a component with assets to load earlier
The video is mounted earlier to give it some time to load.
<br />
It carries the style <code>opacity: 0</code> to make it invisible.
+ <br />
+ It's time defined by{" "}
+ <a href="/docs/use-current-frame">
+ <code>useCurrentFrame()</code>
+ </a>{" "}
+ is frozen at <code>0</code>.
</em>
</sub>
</p>
@@ -42,7 +49,7 @@ Premounting is the practice of mounting a component with assets to load earlier
## Preloading a `<Sequence>`
Use premounting sparingly since having more elements mounted will slow down the page.
-Add the `premountFor` prop to the `<Sequence>` component to enable premounting.
+Add the [`premountFor`](/docs/sequence#premountfor) prop to the [`<Sequence>`](/docs/sequence) component to enable premounting.
The number you pass is the number in frames you premount the component for.
diff --git a/packages/docs/docs/sequence.mdx b/packages/docs/docs/sequence.mdx
index 0d31303de2..0030b154a7 100644
--- a/packages/docs/docs/sequence.mdx
+++ b/packages/docs/docs/sequence.mdx
@@ -14,7 +14,7 @@ const BlueSquare: React.FC = () => <div></div>
By using a sequence, you can time-shift the display of your components or parts of your animation in the video.
-```tsx twoslash
+```tsx twoslash title="MyTrailer.tsx"
import { Sequence } from "remotion";
export const Intro = () => <></>;
@@ -26,13 +26,13 @@ export const Outro = () => <></>;
const MyTrailer = () => {
return (
<>
- <Sequence durationInFrames={10}>
+ <Sequence durationInFrames={30}>
<Intro />
</Sequence>
- <Sequence from={10}>
+ <Sequence from={30} durationInFrames={30}>
<Clip />
</Sequence>
- <Sequence from={20}>
+ <Sequence from={60}>
<Outro />
</Sequence>
</>
@@ -40,72 +40,63 @@ const MyTrailer = () => {
};
```
-All child components inside a `<Sequence>` will have their value of [`useCurrentFrame()`](/docs/use-current-frame) shifted by the `from` value.
-
-Using the `durationInFrames` prop, you can define for how long the children of a `<Sequence>` should be mounted.
-
-By default, the children of a `<Sequence>` are wrapped in an [`<AbsoluteFill>`](/docs/absolute-fill) component. If you don't want this behavior, add `layout="none"` as a prop.
-
-## Props
-
-The Sequence component is a high order component and accepts, besides children, the following props:
-
-### `from`
-
-_optional_ (From v3.2.36, _required_ in previous versions)
-
-At which frame it's children should assume the video starts. When the sequence is at `frame`, it's children are at frame `0`.
-From v3.2.36 onwards, this prop will be optional; by default, it will be 0.
-
-### `durationInFrames`
-
-_optional_
-
-For how many frames the sequence should be displayed. Children are unmounted if they are not within the time range of display. By default it will be `Infinity` to avoid limit the duration of the sequence.
-
-### `height`<AvailableFrom v="4.0.80"/>
-
-_optional_
-
-Gives the sequence a specific `style={{height: height}}` style and overrides `height` that is returned by the [`useVideoConfig()`](/docs/use-video-config) hook in child components. Useful for including a component that was designed for a specific height.
-
-### `width`<AvailableFrom v="4.0.80"/>
-
-_optional_
-
-Gives the sequence a specific `style={{width: width}}` style and overrides `width` that is returned by the [`useVideoConfig()`](/docs/use-video-config) hook in child components. Useful for including a component that was designed for a specific width.
-
-### `name`
-
-_optional_
-
-You can give your sequence a name and it will be shown as the label of the sequence in the timeline of the Remotion Studio. This property is purely for helping you keep track of sequences in the timeline.
-
-### `layout`
-
-_optional_
-
-Either `"absolute-fill"` _(default)_ or `"none"` By default, your sequences will be absolutely positioned, so they will overlay each other. If you would like to opt out of it and handle layouting yourself, pass `layout="none"`. Available since v1.4.
-
-### `style`<AvailableFrom v="3.0.27"/>
-
-_optional_
+<sub>
+ <em>
+ <code>&lt;Intro&gt;</code>
+ </em>{" "}
+ will show from frame 0-29.
+</sub>
+<br />
+<sub>
+ <em>
+ <code>&lt;Clip&gt;</code>
+ </em>{" "}
+ will show from frame 30 on until frame 59.
+</sub>
+<br />
+<sub>
+ <em>
+ <code>&lt;Outro&gt;</code>
+ </em>{" "}
+ will show from frame 60 on until the end of the composition.
+</sub>
+<br />
+<br />
-CSS styles to be applied to the container. If `layout` is set to `none`, there is no container and setting this style is not allowed.
+All children of a `<Sequence>` that call [`useCurrentFrame()`](/docs/use-current-frame) will receive a value that is shifted by [`from`](#from).
-### `className`<AvailableFrom v="3.3.45"/>
+```tsx twoslash title="MyTrailer.tsx"
+import { Sequence, useCurrentFrame } from "remotion";
-_optional_
+const Intro = () => <div>{useCurrentFrame()}</div>;
-A class name to be applied to the container. If `layout` is set to `none`, there is no container and setting this style is not allowed.
+const MyTrailer = () => {
+ return (
+ <>
+ <Intro />
+ <Sequence from={30}>
+ <Intro />
+ </Sequence>
+ </>
+ );
+};
+```
-### `showInTimeline`<AvailableFrom v="4.0.110" />
+<sub>
+ At frame <code>0</code>, this would render{" "}
+ <code>&lt;div&gt;0&lt;/div&gt;</code>.
+</sub>
+<br />
+<sub>
+ At frame <code>30</code>, this would render{" "}
+ <code>&lt;div&gt;30&lt;/div&gt;&lt;div&gt;0&lt;/div&gt;</code>.
+</sub>
+<br />
+<br />
-_optional_
+Using the [`durationInFrames`](#durationinframes) prop, you can define for how long the children of a `<Sequence>` should be mounted.
-If set to `false`, the track will not be shown in the Studio's timeline.
-Child `<Sequence>`'s will show by default, unless `showInTimeline` is also set to false.
-This behavior is stable as of v4.0.110, previously the behavior was different, but this prop not documented.
+By default, the children of a `<Sequence>` are wrapped in an [`<AbsoluteFill>`](/docs/absolute-fill) component. If you don't want this behavior, add [`layout="none"`](#layout) as a prop.
## Cascading
@@ -214,6 +205,73 @@ const TrimAndDelayExample: React.FC = () => {
See the [`<Series />`](/docs/series) helper component, which helps you calculate markup that makes sequences play after each other.
+## Props
+
+The Sequence component is a high order component and accepts, besides children, the following props:
+
+### `from`
+
+_optional_ (From v3.2.36, _required_ in previous versions)
+
+At which frame it's children should assume the video starts. When the sequence is at `frame`, it's children are at frame `0`.
+From v3.2.36 onwards, this prop will be optional; by default, it will be 0.
+
+### `durationInFrames`
+
+_optional_
+
+For how many frames the sequence should be displayed. Children are unmounted if they are not within the time range of display. By default it will be `Infinity` to avoid limit the duration of the sequence.
+
+### `height`<AvailableFrom v="4.0.80"/>
+
+_optional_
+
+Gives the sequence a specific `style={{height: height}}` style and overrides `height` that is returned by the [`useVideoConfig()`](/docs/use-video-config) hook in child components. Useful for including a component that was designed for a specific height.
+
+### `width`<AvailableFrom v="4.0.80"/>
+
+_optional_
+
+Gives the sequence a specific `style={{width: width}}` style and overrides `width` that is returned by the [`useVideoConfig()`](/docs/use-video-config) hook in child components. Useful for including a component that was designed for a specific width.
+
+### `name`
+
+_optional_
+
+You can give your sequence a name and it will be shown as the label of the sequence in the timeline of the Remotion Studio. This property is purely for helping you keep track of sequences in the timeline.
+
+### `layout`
+
+_optional_
+
+Either `"absolute-fill"` _(default)_ or `"none"` By default, your sequences will be absolutely positioned, so they will overlay each other. If you would like to opt out of it and handle layouting yourself, pass `layout="none"`. Available since v1.4.
+
+### `style`<AvailableFrom v="3.0.27"/>
+
+_optional_
+
+CSS styles to be applied to the container. If `layout` is set to `none`, there is no container and setting this style is not allowed.
+
+### `className`<AvailableFrom v="3.3.45"/>
+
+_optional_
+
+A class name to be applied to the container. If `layout` is set to `none`, there is no container and setting this style is not allowed.
+
+### `premountFor`<AvailableFrom v="4.0.140" />
+
+_optional_
+
+[Premount](/docs/player/premounting) the sequence for a set number of frames.
+
+### `showInTimeline`<AvailableFrom v="4.0.110" />
+
+_optional_
+
+If set to `false`, the track will not be shown in the Studio's timeline.
+Child `<Sequence>`'s will show by default, unless `showInTimeline` is also set to false.
+This behavior is stable as of v4.0.110, previously the behavior was different, but this prop not documented.
+
## Adding a ref
You can add a [React ref](https://react.dev/learn/manipulating-the-dom-with-refs) to an `<Sequence>` from version `v3.2.13` on. If you use TypeScript, you need to type it with `HTMLDivElement`:
diff --git a/packages/docs/docs/series.md b/packages/docs/docs/series.md
index 42e40bb42b..5a453b1649 100644
--- a/packages/docs/docs/series.md
+++ b/packages/docs/docs/series.md
@@ -87,6 +87,12 @@ _optional_
A class name to be applied to the container. If `layout` is set to `none`, there is no container and setting this style is not allowed.
+### `premountFor`<AvailableFrom v="4.0.140"/>
+
+_optional_
+
+[Premount](/docs/player/premounting) the sequence for a set number of frames.
+
### `ref`<AvailableFrom v="3.3.4" />
_optional_
diff --git a/packages/docs/docs/terminology/sequence.md b/packages/docs/docs/terminology/sequence.mdx
similarity index 100%
rename from packages/docs/docs/terminology/sequence.md
rename to packages/docs/docs/terminology/sequence.mdx
diff --git a/packages/docs/docs/transitions/transitionseries.mdx b/packages/docs/docs/transitions/transitionseries.mdx
index 843278a425..4614a92905 100644
--- a/packages/docs/docs/transitions/transitionseries.mdx
+++ b/packages/docs/docs/transitions/transitionseries.mdx
@@ -83,7 +83,7 @@ The `<TransitionSeries>` component can only contain `<TransitionSeries.Sequence>
### `<TransitionSeries.Sequence>`
-Inherits the [`durationInFrames`](/docs/sequence#durationinframes), [`name`](/docs/sequence#name), [`className`](/docs/sequence#classname), [`style`](/docs/sequence#style) and [`layout`](/docs/sequence#layout) props from [`<Sequence>`](/docs/sequence).
+Inherits the [`durationInFrames`](/docs/sequence#durationinframes), [`name`](/docs/sequence#name), [`className`](/docs/sequence#classname), [`style`](/docs/sequence#style), [`premountFor`](/docs/sequence#premountfor) and [`layout`](/docs/sequence#layout) props from [`<Sequence>`](/docs/sequence).
As children, put the contents of your scene.
diff --git a/packages/docs/docs/troubleshooting/video-flicker.md b/packages/docs/docs/troubleshooting/video-flicker.md
deleted file mode 100644
index d1af92f8f7..0000000000
--- a/packages/docs/docs/troubleshooting/video-flicker.md
+++ /dev/null
@@ -1,239 +0,0 @@
----
-image: /generated/articles-docs-troubleshooting-video-flicker.png
-id: player-flicker
-title: "Avoiding flickering in <Player>"
-sidebar_label: Avoiding flickers
-crumb: "Frame-perfection"
----
-
-Consider the following markup:
-
-```tsx twoslash title="MyComponent.tsx"
-import { AbsoluteFill, Sequence, Video } from "remotion";
-
-const MyComponent: React.FC = () => {
- return (
- <AbsoluteFill>
- <Sequence from={0} durationInFrames={120}>
- <Video src="https://example.com/video1.mp4" />
- </Sequence>
- <Sequence from={120} durationInFrames={120}>
- <Video src="https://example.com/video2.mp4" />
- </Sequence>
- </AbsoluteFill>
- );
-};
-```
-
-Since Remotion is only aware of the current frame, the video with the source `video2.mp4` will only start loading once it starts appearing in the scene. This can lead to an effect in the Player where some frames will be empty, since the loading of the video will usually not complete immediately.
-
-This is a design tradeoff of Remotion, but can be fought with different levels of aggression.
-
-## Strategies
-
-<strong><Step>1</Step>Option 1: Ignore</strong><br/>
-
-This effect is only happening in the Remotion Studio and the Remotion Player, and will not appear in the rendered video. If you are only looking for a frame-perfect rendered video, you do not need to take additional steps.
-
-<strong><Step>2</Step>Option 2: Pause the <code>{"<Player/>"}</code> when media is buffering</strong><br/>
-
-You may want to pause the `<Player>` temporarily to allow loading of the assets and resume once the assets are ready for playback.<br/> You can do so by adding a `pauseWhenBuffering` prop to your [`<Video>`](/docs/video/#pausewhenbuffering), [`<OffthreadVideo>`](/docs/offthreadvideo/#pausewhenbuffering), [`<Audio>`](/docs/audio/#pausewhenbuffering) and [`<Img>`](/docs/img/#pausewhenbuffering) tags. [Learn more about the buffer state.](/docs/player/buffer-state)
-
-<strong><Step>3</Step>Option 3: Preloading to avoid network request</strong><br/>
-
-You may signal to the browser to preload videos and other assets, so that when the embedded element appears in the video, it can save the network request.
-
-See [Preloading](/docs/player/preloading) for instructions on how to achieve this.
-
-The signal that you give to the browser may be ignored, for example if the device has data saver or battery saver mode enabled. This is specifically a concern for mobile devices.
-
-<strong><Step>4</Step>Option 4: Prefetching as blob URL to more aggressively avoid network request</strong><br/>
-
-By [prefetching](/docs/prefetch) an asset, it will be downloaded and cached into memory. Unlike preloading, you force the browser to download the asset, however, you can only use the loaded asset once it has fully downloaded.
-
-<strong><Step>5</Step>Option 5: Prefetching as Base64 to avoid network request and local HTTP server</strong><br/>
-
-In Safari prefetching as described in <InlineStep>4</InlineStep> is not enough, since the Blob URL will be saved to disk and a slight delay may still occur even if the asset is pre-saved.
-
-Alternatively, the [`prefetch()`](/docs/prefetch) function allows to fetch an asset and save it in memory as Base64, which does not require the blob URL to be loaded from disk through HTTP.
-
-<strong><Step>6</Step>Option 6: Premounting the video</strong><br/>
-
-As the most aggressive strategy, you can pre-mount a video to already trigger decoding of the video. Use the following component to pre-mount a video:
-
-```tsx twoslash title="Premount.tsx"
-import React, { useContext, useMemo } from "react";
-import { Internals, TimelineContextValue, useVideoConfig } from "remotion";
-
-type PremountProps = {
- for: number;
- children: React.ReactNode;
-};
-
-export const Premount: React.FC<PremountProps> = ({
- for: premountFor,
- children,
-}) => {
- const sequenceContext = useContext(Internals.SequenceContext);
- const { id } = useVideoConfig();
- if (typeof premountFor === "undefined") {
- throw new Error(
- `The <Premount /> component requires a 'for' prop, but none was passed.`,
- );
- }
-
- if (typeof premountFor !== "number") {
- throw new Error(
- `The 'for' prop of <Premount /> must be a number, but is of type ${typeof premountFor}`,
- );
- }
-
- if (Number.isNaN(premountFor)) {
- throw new Error(
- `The 'for' prop of <Premount /> must be a real number, but it is NaN.`,
- );
- }
-
- if (!Number.isFinite(premountFor)) {
- throw new Error(
- `The 'for' prop of <Premount /> must be a finite number, but it is ${premountFor}.`,
- );
- }
-
- const context = useContext(Internals.Timeline.TimelineContext);
- const value: TimelineContextValue = useMemo(() => {
- const contextOffset = sequenceContext
- ? sequenceContext.cumulatedFrom + sequenceContext.relativeFrom
- : 0;
-
- // v3
- // const currentFrame = context.frame - contextOffset;
- // v4
- const currentFrame = (context.frame[id] ?? 0) - contextOffset;
- return {
- ...context,
- playing: currentFrame < premountFor ? false : context.playing,
- imperativePlaying: {
- current:
- currentFrame < premountFor
- ? false
- : context.imperativePlaying.current,
- },
- // Remotion v4
- frame: { [id]: Math.max(0, currentFrame - premountFor) + contextOffset },
- // Remotion v3
- // frame: Math.max(0, currentFrame - premountFor) + contextOffset,
- };
- }, [context, premountFor, sequenceContext, id]);
-
- return (
- <Internals.Timeline.TimelineContext.Provider value={value}>
- {children}
- </Internals.Timeline.TimelineContext.Provider>
- );
-};
-```
-
-The following usage would make the video mount 60 frames before it appears in the scene:
-
-```tsx twoslash title="MyComponent.tsx"
-import React, { useContext, useMemo } from "react";
-import { Internals, TimelineContextValue, useVideoConfig } from "remotion";
-
-type PremountProps = {
- for: number;
- children: React.ReactNode;
-};
-
-export const Premount: React.FC<PremountProps> = ({
- for: premountFor,
- children,
-}) => {
- const { id } = useVideoConfig();
- const sequenceContext = useContext(Internals.SequenceContext);
- if (typeof premountFor === "undefined") {
- throw new Error(
- `The <Premount /> component requires a 'for' prop, but none was passed.`,
- );
- }
-
- if (typeof premountFor !== "number") {
- throw new Error(
- `The 'for' prop of <Premount /> must be a number, but is of type ${typeof premountFor}`,
- );
- }
-
- if (Number.isNaN(premountFor)) {
- throw new Error(
- `The 'for' prop of <Premount /> must be a real number, but it is NaN.`,
- );
- }
-
- if (!Number.isFinite(premountFor)) {
- throw new Error(
- `The 'for' prop of <Premount /> must be a finite number, but it is ${premountFor}.`,
- );
- }
-
- const context = useContext(Internals.Timeline.TimelineContext);
- const value: TimelineContextValue = useMemo(() => {
- const contextOffset = sequenceContext
- ? sequenceContext.cumulatedFrom + sequenceContext.relativeFrom
- : 0;
-
- // v3
- // const currentFrame = context.frame - contextOffset;
- // v4
- const currentFrame = (context.frame[id] ?? 0) - contextOffset;
- return {
- ...context,
- playing: currentFrame < premountFor ? false : context.playing,
- imperativePlaying: {
- current:
- currentFrame < premountFor
- ? false
- : context.imperativePlaying.current,
- },
- // Remotion v4
- frame: { [id]: Math.max(0, currentFrame - premountFor) + contextOffset },
- // Remotion v3
- // frame: Math.max(0, currentFrame - premountFor) + contextOffset,
- };
- }, [context, premountFor, sequenceContext]);
-
- return (
- <Internals.Timeline.TimelineContext.Provider value={value}>
- {children}
- </Internals.Timeline.TimelineContext.Provider>
- );
-};
-// ---cut---
-import { AbsoluteFill, Sequence, Video } from "remotion";
-
-const MyComponent: React.FC = () => {
- return (
- <AbsoluteFill>
- <Sequence from={0} durationInFrames={120}>
- <Video src="https://example.com/video1.mp4" />
- </Sequence>
- <Sequence from={60} durationInFrames={180}>
- <Premount for={60}>
- <Video src="https://example.com/video2.mp4" />
- </Premount>
- </Sequence>
- </AbsoluteFill>
- );
-};
-```
-
-You are responsible yourself for making the video invisible while it is being pre-mounted.
-
-## See also
-
-- [Preloading assets](/docs/player/preloading)
-- [Displaying a buffer state](/docs/buffer-state)
-- [`prefetch()`](/docs/prefetch)
-- [`@remotion/preload` vs `prefetch()`](/docs/player/preloading#remotionpreload-vs-prefetch)
-- [`preloadVideo()`](/docs/preload/preload-video)
-- [Flickering (during rendering)](/docs/flickering)
-- [Premounting](/docs/player/premounting)
diff --git a/packages/docs/docs/troubleshooting/video-flicker.mdx b/packages/docs/docs/troubleshooting/video-flicker.mdx
new file mode 100644
index 0000000000..743def8765
--- /dev/null
+++ b/packages/docs/docs/troubleshooting/video-flicker.mdx
@@ -0,0 +1,83 @@
+---
+image: /generated/articles-docs-troubleshooting-video-flicker.png
+id: player-flicker
+title: "Avoiding flickering in <Player>"
+sidebar_label: Avoiding flickers
+crumb: "Frame-perfection"
+---
+
+Consider the following markup:
+
+```tsx twoslash title="MyComponent.tsx"
+import { AbsoluteFill, Sequence, Video } from "remotion";
+
+const MyComponent: React.FC = () => {
+ return (
+ <AbsoluteFill>
+ <Sequence from={0} durationInFrames={120}>
+ <Video src="https://example.com/video1.mp4" />
+ </Sequence>
+ <Sequence from={120} durationInFrames={120}>
+ <Video src="https://example.com/video2.mp4" />
+ </Sequence>
+ </AbsoluteFill>
+ );
+};
+```
+
+Since Remotion is only aware of the current frame, the video with the source `video2.mp4` will only start loading once it starts appearing in the scene. This can lead to an effect in the Player where some frames will be empty, since the loading of the video will usually not complete immediately.
+
+This is a design tradeoff of Remotion, but can be fought with different levels of aggression.
+
+## Strategies
+
+### Option 1: Ignore
+
+This effect is only happening in the Remotion Studio and the Remotion Player, and will not appear in the rendered video. If you are only looking for a frame-perfect rendered video, you do not need to take additional steps.
+
+### Option 2: Pause the `<Player />` when media is buffering
+
+You may want to pause the `<Player>` temporarily to allow loading of the assets and resume once the assets are ready for playback.
+
+You can do so by adding a `pauseWhenBuffering` prop to your [`<Video>`](/docs/video/#pausewhenbuffering), [`<OffthreadVideo>`](/docs/offthreadvideo/#pausewhenbuffering), [`<Audio>`](/docs/audio/#pausewhenbuffering) and [`<Img>`](/docs/img/#pausewhenbuffering) tags. [Learn more about the buffer state.](/docs/player/buffer-state)
+
+### Option 3: Preloading to avoid network request
+
+You may signal to the browser to preload videos and other assets, so that when the embedded element appears in the video, it can save the network request.
+
+See [Preloading](/docs/player/preloading) for instructions on how to achieve this.
+
+:::note
+The signal that you give to the browser may be ignored, for example if the device has data saver or battery saver mode enabled. This is specifically a concern for mobile devices.
+:::
+
+### Option 4: Premounting the video<AvailableFrom v="4.0.140"/>
+
+You can mount a sequence a few frames earlier than when it starts to appear.
+This will give it time to load before it is visible to the user, which can help to avoid flickering.
+
+See [Premounting](/docs/player/premounting) for an example.
+
+### Option 5: Prefetching as blob URL to more aggressively avoid network request
+
+By [prefetching](/docs/prefetch) an asset, it will be downloaded and cached into memory. Unlike preloading, you force the browser to download the asset, however, you can only use the loaded asset once it has fully downloaded.
+
+:::note
+Even a preloaded asset or prefetched needs to be mounted in the DOM and be decoded by the browser, which can take a short amount of time.
+:::
+
+### Option 6: Prefetching as Base64 to avoid network request and local HTTP server
+
+In Safari prefetching as described in Option <InlineStep>5</InlineStep> is not enough, since the Blob URL will be saved to disk and a slight delay may still occur even if the asset is pre-saved.
+
+Alternatively, the [`prefetch()`](/docs/prefetch) function allows to fetch an asset and save it in memory as Base64, which does not require the blob URL to be loaded from disk through HTTP.
+
+## See also
+
+- [Preloading assets](/docs/player/preloading)
+- [Displaying a buffer state](/docs/buffer-state)
+- [`prefetch()`](/docs/prefetch)
+- [`@remotion/preload` vs `prefetch()`](/docs/player/preloading#remotionpreload-vs-prefetch)
+- [`preloadVideo()`](/docs/preload/preload-video)
+- [Flickering (during rendering)](/docs/flickering)
+- [Premounting](/docs/player/premounting)
diff --git a/packages/docs/docs/version.md b/packages/docs/docs/version.mdx
similarity index 59%
rename from packages/docs/docs/version.md
rename to packages/docs/docs/version.mdx
index c1da1ad4bb..c8c7a13675 100644
--- a/packages/docs/docs/version.md
+++ b/packages/docs/docs/version.mdx
@@ -5,18 +5,18 @@ title: VERSION
crumb: "API"
---
-You may import this constant to get the current version of Remotion.
-This can be useful for displaying the Remotion version number in your application or for other version-specific operations.
+You may import this constant to get the current version of Remotion.
-Only the version of the `remotion` package will be reported. A [version conflict](/docs/cli/versions) with other Remotion packages cannot be ruled out.
+Only the version of the [`remotion`](/docs/remotion) package will be reported.
+A [version conflict](/docs/cli/versions) with other Remotion packages cannot be ruled out.
-```ts twoslash title="Importing VERSION from remotion/version"
+```ts twoslash title="Importing VERSION from remotion"
import { VERSION } from "remotion";
console.log(VERSION); // "4.0.57";
```
-You can also import it from `remotion/version` to avoid importing Remotion and its dependencies (React):
+You can also import it from `remotion/version` to avoid importing Remotion and its dependencies (i.e, `react` and `react-dom`):
```ts twoslash title="Importing VERSION from remotion/version"
import { VERSION } from "remotion/version";
diff --git a/packages/docs/src/data/articles.ts b/packages/docs/src/data/articles.ts
index 238dd7d682..2d551a3366 100644
--- a/packages/docs/src/data/articles.ts
+++ b/packages/docs/src/data/articles.ts
@@ -2080,6 +2080,13 @@ export const articles = [
compId: "articles-docs-player-preloading",
crumb: "@remotion/player",
},
+ {
+ id: "player/premounting",
+ title: "Premounting",
+ relativePath: "docs/player/premounting.mdx",
+ compId: "articles-docs-player-premounting",
+ crumb: "@remotion/player",
+ },
{
id: "scaling",
title: "Sizing",
@@ -2818,7 +2825,7 @@ export const articles = [
{
id: "terminology/sequence",
title: "Sequence",
- relativePath: "docs/terminology/sequence.md",
+ relativePath: "docs/terminology/sequence.mdx",
compId: "articles-docs-terminology-sequence",
crumb: "Terminology",
},
@@ -3091,7 +3098,7 @@ export const articles = [
{
id: "player-flicker",
title: "Avoiding flickering in <Player>",
- relativePath: "docs/troubleshooting/video-flicker.md",
+ relativePath: "docs/troubleshooting/video-flicker.mdx",
compId: "articles-docs-troubleshooting-video-flicker",
crumb: "Frame-perfection",
},
@@ -3182,7 +3189,7 @@ export const articles = [
{
id: "version",
title: "VERSION",
- relativePath: "docs/version.md",
+ relativePath: "docs/version.mdx",
compId: "articles-docs-version",
crumb: "API",
},
diff --git a/packages/docs/static/generated/articles-docs-player-premounting.png b/packages/docs/static/generated/articles-docs-player-premounting.png
new file mode 100644
index 0000000000..014483a966
Binary files /dev/null and b/packages/docs/static/generated/articles-docs-player-premounting.png differ