Bluesky app fork with some witchin' additions 💫

Fix quality of first seconds of videos on web (#8761) (#8778)

authored by

Arturo Fonseca and committed by
GitHub
fd37d92f 53cf0b3b

+5 -1
+5 -1
src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.tsx
··· 224 224 throw new HLSUnsupportedError() 225 225 } 226 226 227 + const latestEstimate = BandwidthEstimate.get() 227 228 const hls = new Hls({ 228 229 maxMaxBufferLength: 10, // only load 10s ahead 229 230 // note: the amount buffered is affected by both maxBufferLength and maxBufferSize 230 231 // it will buffer until it is greater than *both* of those values 231 232 // so we use maxMaxBufferLength to set the actual maximum amount of buffering instead 233 + startLevel: 234 + latestEstimate === undefined ? -1 : Hls.DefaultConfig.startLevel, 235 + // the '-1' value makes a test request to estimate bandwidth and quality level 236 + // before showing the first fragment 232 237 }) 233 238 hlsRef.current = hls 234 239 235 - const latestEstimate = BandwidthEstimate.get() 236 240 if (latestEstimate !== undefined) { 237 241 hls.bandwidthEstimate = latestEstimate 238 242 }