Why does hls.js download the largest segment on slow connections #6989
Replies: 2 comments 3 replies
-
Adding some debug logs
|
Beta Was this translation helpful? Give feedback.
-
Ok, I think I solved this by adding startLeve = -1 here
Available levels: [{"_attrs":[{"BANDWIDTH":"500k","RESOLUTION":"854x480"}],"bitrate":500,"codecSet":"","url":["http://localhost:3000/video-480p/480p.m3u8"],"frameRate":0,"height":480,"id":0,"width":854,"fragmentError":0,"loadError":0,"realBitrate":0,"_avgBitrate":null,"_urlId":0},{"_attrs":[{"BANDWIDTH":"1000k","RESOLUTION":"1280x720"}],"bitrate":1000,"codecSet":"","url":["http://localhost:3000/video-720p/720p.m3u8"],"frameRate":0,"height":720,"id":0,"width":1280,"fragmentError":0,"loadError":0,"realBitrate":0,"_avgBitrate":null,"_urlId":0},{"_attrs":[{"BANDWIDTH":"1500k","RESOLUTION":"1920x1080"}],"bitrate":1500,"codecSet":"","url":["http://localhost:3000/video-1080p/1080p.m3u8"],"frameRate":0,"height":1080,"id":0,"width":1920,"fragmentError":0,"loadError":0,"realBitrate":0,"_avgBitrate":null,"_urlId":0}]
|
Beta Was this translation helpful? Give feedback.
-
I've been trying to figure out the algorithm for how it selects its first segment to download. In the picture below, you can see that I have network capped at 3G speeds. The index.m3u8 has the following
I've scaled down the responsive viewport to cell phone size. Then Empty Cache/Hard Reload. It seems like no matter what HLS.JS downloads the 1080p version first taking 22 seconds to then realize the internet is slow so it should download the 480p version. Going forward.
Here is my sample code:
Any thoughts?
Beta Was this translation helpful? Give feedback.
All reactions