Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

hls buffering tweaks (#5266)

authored by

Samuel Newman and committed by
GitHub
b04ecbe5 db384385

+11 -1
+7 -1
src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerWeb.tsx
··· 35 35 if (!ref.current) return 36 36 if (!Hls.isSupported()) throw new HLSUnsupportedError() 37 37 38 - const hls = new Hls({capLevelToPlayerSize: true}) 38 + const hls = new Hls({ 39 + capLevelToPlayerSize: true, 40 + maxMaxBufferLength: 10, // only load 10s ahead 41 + // note: the amount buffered is affected by both maxBufferLength and maxBufferSize 42 + // it will buffer until it it's greater than *both* of those values 43 + // so we use maxMaxBufferLength to set the actual maximum amount of buffering instead 44 + }) 39 45 hlsRef.current = hls 40 46 41 47 hls.attachMedia(ref.current)
+4
src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx
··· 130 130 if (focused) { 131 131 // auto decide quality based on network conditions 132 132 hlsRef.current.autoLevelCapping = -1 133 + // allow 30s of buffering 134 + hlsRef.current.config.maxMaxBufferLength = 30 133 135 } else { 136 + // back to what we initially set 134 137 hlsRef.current.autoLevelCapping = 0 138 + hlsRef.current.config.maxMaxBufferLength = 10 135 139 } 136 140 }, [hlsRef, focused]) 137 141