···3535 if (!ref.current) return
3636 if (!Hls.isSupported()) throw new HLSUnsupportedError()
37373838- const hls = new Hls({capLevelToPlayerSize: true})
3838+ const hls = new Hls({
3939+ capLevelToPlayerSize: true,
4040+ maxMaxBufferLength: 10, // only load 10s ahead
4141+ // note: the amount buffered is affected by both maxBufferLength and maxBufferSize
4242+ // it will buffer until it it's greater than *both* of those values
4343+ // so we use maxMaxBufferLength to set the actual maximum amount of buffering instead
4444+ })
3945 hlsRef.current = hls
40464147 hls.attachMedia(ref.current)