{"action":"reopened","issue":{"url":"https://api.github.com/repos/videojs/videojs-contrib-hls/issues/277","labels_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/issues/277/labels{/name}","comments_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/issues/277/comments","events_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/issues/277/events","html_url":"https://github.com/videojs/videojs-contrib-hls/issues/277","id":79357698,"number":277,"title":"Overriding first playlist selection","user":{"login":"vasklund","id":5039480,"avatar_url":"https://avatars.githubusercontent.com/u/5039480?v=3","gravatar_id":"","url":"https://api.github.com/users/vasklund","html_url":"https://github.com/vasklund","followers_url":"https://api.github.com/users/vasklund/followers","following_url":"https://api.github.com/users/vasklund/following{/other_user}","gists_url":"https://api.github.com/users/vasklund/gists{/gist_id}","starred_url":"https://api.github.com/users/vasklund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vasklund/subscriptions","organizations_url":"https://api.github.com/users/vasklund/orgs","repos_url":"https://api.github.com/users/vasklund/repos","events_url":"https://api.github.com/users/vasklund/events{/privacy}","received_events_url":"https://api.github.com/users/vasklund/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/videojs/videojs-contrib-hls/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-22T08:42:27Z","updated_at":"2015-06-01T19:24:11Z","closed_at":null,"body":"We are having problems with the initial segment almost always being downloaded in the lowest bitrate, even when available bandwidth allows for playback at higher quality. This is a pretty big problem for short clips (a lot of our clips are around 30-120 sec long).\r\n\r\nI know we can override `selectPlaylist` to implement our own selection algorithm, or set `player.hls.bandwidth` higher to make `selectPlaylist` return a higher quality playlist. The problem is that the code in `this.playlists.on('loadedmetadata', function { ... })`, which is responsible for selecting the first playlist, will not respect the playlist returned from `selectPlaylist` if the estimated download time for the first segment is more than 10 seconds. This seems reasonable, but the problem is that it will then fallback to the **lowest** bitrate, instead of selecting the highest quality playlist that satisfies both available bandwidth and initial load time (10 seconds).\r\n\r\nEssentially, we want to trade high quality (from the first segment) for longer startup time, but there is no good way to do so now. I'm experimenting with some alternate approaches and will try to prepare a pull request today, but I'm interested in getting some feedback."}}