Hls.js: HLSJS always loads the first level

Created on 20 Jun 2017  路  4Comments  路  Source: video-dev/hls.js

Hi,

I have a 3 levels playlist: high, medium and low. HLS JS always load the first level when they have position like this

if: bw <= high

  • m3u8_high
    if: bw <= medium
  • m3u8_medium
    if: bw <= low
  • m3u8_low

If client's network is good, this is not problem, but with the low bandwidth, client has to wait a long long time to see video (Because, HLS JS loads the m3u8_high before and client has to wait for XHRLoader loads completely the first TS file of m3u8_high, then checking bandwidth and load the next level until the bandwidth is enough to play). So how can I always load the m3u8_low before? (Have any config in HLS JS?)

Thanks!

Question

Most helpful comment

Thanks!

Just starting with level 0 :D HLS JS will select the lowest level

 var config =  {
              maxSeekHole: 6,
                startLevel: 0,
}

Hi,
How to make HLS JS select the highest level by default.
Thanks

All 4 comments

By default the level first listed in the variant playlist is used (like in native playback). You can change that with startLevel:
https://github.com/video-dev/hls.js/blob/master/doc/API.md#startlevel
https://github.com/video-dev/hls.js/blob/master/doc/API.md#hlsstartlevel

Thanks!

Just starting with level 0 :D HLS JS will select the lowest level

 var config =  {
                maxSeekHole: 6,
                startLevel: 0,
}

Indeed ;-)
Side note: avoid commas before closing braces, some browsers may have trouble with them.

Thanks!

Just starting with level 0 :D HLS JS will select the lowest level

 var config =  {
              maxSeekHole: 6,
                startLevel: 0,
}

Hi,
How to make HLS JS select the highest level by default.
Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

itsjamie picture itsjamie  路  3Comments

ronag picture ronag  路  4Comments

eteubert picture eteubert  路  3Comments

shalommeoded picture shalommeoded  路  3Comments

PeterBassemYoussef picture PeterBassemYoussef  路  3Comments