Fix video quality for short videos (#5996)

* remove auto level capping

* flush first fragment on loop
This commit is contained in:
Samuel Newman
2024-10-29 15:35:43 +02:00
committed by GitHub
parent 80c5f23da2
commit d1355d52fc
2 changed files with 36 additions and 13 deletions
@@ -138,13 +138,10 @@ export function Controls({
useEffect(() => {
if (!hlsRef.current) return
if (focused) {
// auto decide quality based on network conditions
hlsRef.current.autoLevelCapping = -1
// allow 30s of buffering
hlsRef.current.config.maxMaxBufferLength = 30
} else {
// back to what we initially set
hlsRef.current.autoLevelCapping = 0
hlsRef.current.config.maxMaxBufferLength = 10
}
}, [hlsRef, focused])