···224224 throw new HLSUnsupportedError()
225225 }
226226227227+ const latestEstimate = BandwidthEstimate.get()
227228 const hls = new Hls({
228229 maxMaxBufferLength: 10, // only load 10s ahead
229230 // note: the amount buffered is affected by both maxBufferLength and maxBufferSize
230231 // it will buffer until it is greater than *both* of those values
231232 // so we use maxMaxBufferLength to set the actual maximum amount of buffering instead
233233+ startLevel:
234234+ latestEstimate === undefined ? -1 : Hls.DefaultConfig.startLevel,
235235+ // the '-1' value makes a test request to estimate bandwidth and quality level
236236+ // before showing the first fragment
232237 })
233238 hlsRef.current = hls
234239235235- const latestEstimate = BandwidthEstimate.get()
236240 if (latestEstimate !== undefined) {
237241 hls.bandwidthEstimate = latestEstimate
238242 }