about summary refs log tree commit diff
path: root/src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerWeb.tsx
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-09-11 16:20:20 +0100
committerGitHub <noreply@github.com>2024-09-11 16:20:20 +0100
commitb04ecbe54d2cb0581b8b33a46dc07d5d5e978c13 (patch)
tree90b1cf2a126de5075f8c7b556f63e40853ed9eac /src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerWeb.tsx
parentdb38438549aa878a89ba1fb2198e6454f50367c4 (diff)
downloadvoidsky-b04ecbe54d2cb0581b8b33a46dc07d5d5e978c13.tar.zst
hls buffering tweaks (#5266)
Diffstat (limited to 'src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerWeb.tsx')
-rw-r--r--src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerWeb.tsx8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerWeb.tsx b/src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerWeb.tsx
index a30c0e1e9..441be7572 100644
--- a/src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerWeb.tsx
+++ b/src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerWeb.tsx
@@ -35,7 +35,13 @@ export function VideoEmbedInnerWeb({
     if (!ref.current) return
     if (!Hls.isSupported()) throw new HLSUnsupportedError()
 
-    const hls = new Hls({capLevelToPlayerSize: true})
+    const hls = new Hls({
+      capLevelToPlayerSize: true,
+      maxMaxBufferLength: 10, // only load 10s ahead
+      // note: the amount buffered is affected by both maxBufferLength and maxBufferSize
+      // it will buffer until it it's greater than *both* of those values
+      // so we use maxMaxBufferLength to set the actual maximum amount of buffering instead
+    })
     hlsRef.current = hls
 
     hls.attachMedia(ref.current)