hls buffering tweaks (#5266)

This commit is contained in:
Samuel Newman
2024-09-11 16:20:20 +01:00
committed by GitHub
parent db38438549
commit b04ecbe54d
2 changed files with 11 additions and 1 deletions
@@ -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)