Skip to content

🎥 Make videos programmatically with React

Update HLS Docs

Jonny Burgerbb0e21671ab7
diff --git a/packages/docs/docs/miscellaneous/snippets/hls.md b/packages/docs/docs/miscellaneous/snippets/hls.md
index b659063f56..2566f29b79 100644
--- a/packages/docs/docs/miscellaneous/snippets/hls.md
+++ b/packages/docs/docs/miscellaneous/snippets/hls.md
@@ -38,7 +38,20 @@ const HlsVideo: React.FC<RemotionVideoProps> = ({ src }) => {
throw new Error("src is required");
}
- const hls = new Hls();
+ const startFrom = 0;
+
+ const hls = new Hls({
+ enableWorker: !isSafari(),
+ lowLatencyMode: true,
+ backBufferLength: 20,
+ startLevel: 4,
+ maxBufferLength: 5,
+ maxMaxBufferLength: 5,
+ });
+
+ hls.on(Hls.Events.MANIFEST_PARSED, () => {
+ hls.startLoad(startFrom);
+ });
hls.loadSource(src);
hls.attachMedia(videoRef.current!);