Skip to content

🎥 Make videos programmatically with React

`@remotion/example`: Add HLS test compositions using @remotion/media

Jonny Burgerc43671bf6376
diff --git a/packages/example/src/Hls/HlsMediaVideo.tsx b/packages/example/src/Hls/HlsMediaVideo.tsx
new file mode 100644
index 0000000000..755c031db3
--- /dev/null
+++ b/packages/example/src/Hls/HlsMediaVideo.tsx
@@ -0,0 +1,35 @@
+import {Video} from '@remotion/media';
+import React from 'react';
+import {AbsoluteFill} from 'remotion';
+
+export const HlsMediaVideo: React.FC = () => {
+ return (
+ <AbsoluteFill>
+ <Video src="https://stream.mux.com/nqGuji1CJuoPoU3iprRRhiy3HXiQN0201HLyliOg44HOU.m3u8" />
+ </AbsoluteFill>
+ );
+};
+
+export const HlsMediaVideoTrimmed: React.FC = () => {
+ return (
+ <AbsoluteFill>
+ <Video
+ src="https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8"
+ trimBefore={60}
+ trimAfter={150}
+ />
+ </AbsoluteFill>
+ );
+};
+
+export const HlsMediaVideoMuted: React.FC = () => {
+ return (
+ <AbsoluteFill>
+ <Video
+ src="https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8"
+ muted
+ loop
+ />
+ </AbsoluteFill>
+ );
+};
diff --git a/packages/example/src/Root.tsx b/packages/example/src/Root.tsx
index b87e15daa7..4cd6f869b9 100644
--- a/packages/example/src/Root.tsx
+++ b/packages/example/src/Root.tsx
@@ -38,6 +38,11 @@ import {FreezeExample} from './Freeze/FreezeExample';
import {FreezePortion} from './FreezePortion/FreezePortion';
import {Green} from './Green';
import {HlsDemo} from './Hls/HlsDemo';
+import {
+ HlsMediaVideo,
+ HlsMediaVideoMuted,
+ HlsMediaVideoTrimmed,
+} from './Hls/HlsMediaVideo';
import {HugeImage} from './HugeImage';
import {HugePayload, hugePayloadSchema} from './HugePayload';
import {Layers} from './Layers';
@@ -793,6 +798,30 @@ export const Index: React.FC = () => {
durationInFrames={100}
fps={30}
/>
+ <Composition
+ id="hls-media-video"
+ component={HlsMediaVideo}
+ width={1920}
+ height={1080}
+ durationInFrames={300}
+ fps={30}
+ />
+ <Composition
+ id="hls-media-video-trimmed"
+ component={HlsMediaVideoTrimmed}
+ width={1920}
+ height={1080}
+ durationInFrames={90}
+ fps={30}
+ />
+ <Composition
+ id="hls-media-video-muted"
+ component={HlsMediaVideoMuted}
+ width={1920}
+ height={1080}
+ durationInFrames={150}
+ fps={30}
+ />
<Composition
id="video-testing-mp4"
component={VideoTesting}