Skip to content

🎥 Make videos programmatically with React

nice

JonnyBurgercb38e08294ab
diff --git a/.claude/skills/writing-docs/SKILL.md b/.claude/skills/writing-docs/SKILL.md
index cd07d5fd2f..cc172b7f1f 100644
--- a/.claude/skills/writing-docs/SKILL.md
+++ b/.claude/skills/writing-docs/SKILL.md
@@ -118,6 +118,22 @@ For section headings:
## Saving to another cloud<AvailableFrom v="3.2.23" />
```
+### CompatibilityTable
+
+Use to indicate which runtimes and environments a component or API supports. No import needed. Place it in a `## Compatibility` section before `## See also`.
+
+Available boolean props: `chrome`, `firefox`, `safari`, `player`, `studio`, `clientSideRendering`, `serverSideRendering`. Set to `true` (supported) or `{false}` (not supported).
+
+Set to empty string `""` for not applicable: `nodejs=""`, `bun=""`, `serverlessFunctions=""`.
+
+Use `hideServers` to hide the Node.js/Bun/serverless row.
+
+```md
+## Compatibility
+
+<CompatibilityTable chrome firefox safari nodejs="" bun="" serverlessFunctions="" clientSideRendering={false} serverSideRendering player studio hideServers />
+```
+
### Optional parameters
For optional parameters in API documentation:
diff --git a/packages/docs/components/demos/LightLeakDemo.tsx b/packages/docs/components/demos/LightLeakDemo.tsx
index 17f8f3fd55..9ac1c37a34 100644
--- a/packages/docs/components/demos/LightLeakDemo.tsx
+++ b/packages/docs/components/demos/LightLeakDemo.tsx
@@ -1,6 +1,6 @@
import {LightLeak} from '@remotion/light-leaks';
import React from 'react';
-import {AbsoluteFill} from 'remotion';
+import {AbsoluteFill, useVideoConfig} from 'remotion';
interface Props {
readonly seed: number;
@@ -8,9 +8,14 @@ interface Props {
}
export const LightLeakDemoComp: React.FC<Props> = ({seed, hueShift}) => {
+ const {durationInFrames} = useVideoConfig();
return (
<AbsoluteFill style={{backgroundColor: 'black'}}>
- <LightLeak seed={seed} hueShift={hueShift} />
+ <LightLeak
+ seed={seed}
+ hueShift={hueShift}
+ durationInFrames={durationInFrames}
+ />
</AbsoluteFill>
);
};
diff --git a/packages/docs/docs/light-leaks/light-leak.mdx b/packages/docs/docs/light-leaks/light-leak.mdx
index ec0dd8c700..d728794d70 100644
--- a/packages/docs/docs/light-leaks/light-leak.mdx
+++ b/packages/docs/docs/light-leaks/light-leak.mdx
@@ -5,7 +5,9 @@ title: '<LightLeak>'
# &lt;LightLeak&gt;<AvailableFrom v="4.0.415" />
-Renders a WebGL-based light leak effect. The effect reveals during the first half of the duration and retracts during the second half.
+Renders a WebGL-based light leak effect.
+The effect reveals during the first half of the duration and retracts during the second half.
+Is a [`<Sequence>`](/docs/sequence) component under the hood and accepts it's props.
## Example
@@ -28,6 +30,10 @@ const MyVideo = () => {
Apart from the props listed below, all props from [`<Sequence>`](/docs/sequence) except `children` and `layout` are accepted.
+### `durationInFrames`
+
+The duration of the light leak effect in [frames](/docs/terminology/frame). The effect reveals during the first half and retracts during the second half.
+
### `seed?`
Determines the shape of the light leak pattern. Different seeds produce different patterns. Default: `0`.
@@ -40,6 +46,10 @@ Rotates the hue of the light leak in degrees (`0`-`360`).
- `120` shifts toward green
- `240` shifts toward blue
+## Compatibility
+
+<CompatibilityTable chrome firefox safari nodejs="" bun="" serverlessFunctions="" clientSideRendering serverSideRendering player studio hideServers />
+
## See also
- [Source code for this component](https://github.com/remotion-dev/remotion/blob/main/packages/light-leaks/src/LightLeak.tsx)
diff --git a/packages/light-leaks/src/LightLeak.tsx b/packages/light-leaks/src/LightLeak.tsx
index fe8392df3f..4130d0ebf6 100644
--- a/packages/light-leaks/src/LightLeak.tsx
+++ b/packages/light-leaks/src/LightLeak.tsx
@@ -2,7 +2,11 @@ import React, {useCallback, useEffect, useRef} from 'react';
import type {SequenceProps} from 'remotion';
import {AbsoluteFill, Sequence, useCurrentFrame, useVideoConfig} from 'remotion';
-export type LightLeakProps = Omit<SequenceProps, 'children' | 'layout'> & {
+export type LightLeakProps = Omit<
+ SequenceProps,
+ 'children' | 'layout' | 'durationInFrames'
+> & {
+ readonly durationInFrames: number;
readonly seed?: number;
readonly hueShift?: number;
};