question

Kevin W Palmer avatar image
Kevin W Palmer asked

Change bitrates in HLS stream?

Amazon Fire supports HLS in the video tag. That works no problem with m3u8 files. How do i change the bitrates or specifically the starting bitrates for the stream? Is that even possible? If not can Amazon suggest a player that works well with Fire that can do that?
fire tv
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Tarun@Amazon avatar image
Tarun@Amazon answered
Kevin, In your post you mentioned “video tag”, so I am assuming here that your app and the video playback is currently using web-view. Currently there is no way for an application using web-view to specify the initial bit rate or manually select a bitrate variant in HLS. As specified by the HLS spec, the playback will start at the first bitrate variant specified in the HLS media playlist (which may or may not be the lowest bitrate variant depending on how your media playlist looks), and then adapt by switching to higher/lower bitrate variants available in the HLS media playlist depending on network speed and other factors. If you wish to explore other player solutions, take a look at ExoPlayer which is an open-sourced media player alternative available that might allow you more control over what the player does. However, using an external player to handle media playback will not be compatible with web-view, and you will have to implement the supporting player setup/life cycle maintenance/ playback activity/player controls etc code yourself which is a non-trivial amount of work. Here are a few pointers to help you get started. You can read/watch about the ExoPlayer project here: http://developer.android.com/guide/topics/media/exoplayer.html A nice intro video: https://www.youtube.com/watch?v=6VjF638VObA Vanilla ExoPlayer has some issues on Amazon FireTV and tablet devices, Amazon has an ExoPlayer port that contains amazon’s patches on top of ExoPlayer releases to enable it on Amazon’s devices (patches should be compatible with other android devices too). Link to the Amazon ExoPlayer port github: https://github.com/amzn/exoplayer-amazon-port In ExoPlayer 1.5.5/1.5.6, there should be an API which allows you to select an HLS variant track (but the player may no longer be adaptive if you force it to use a specific has variant). Play around with the demo activity/player to see how it behaves. The Amazon’s ExoPlayer github has a patch for ExoPlayer ver. 1.5.5/1.5.6 which allows application to set an initial bitrate but still allow player to be adaptive. You an view the patch here: https://github.com/amzn/exoplayer-amazon-port/commit/aa154717c82549beb4e998959e3a72beff431e6c In future this patch may make it’s way to vanilla ExoPlayer or ExoPlayer might develop it’s own approach for specifying initial bitrates in which case this patch maybe discarded. Please keep this in mind when rebasing to use new ExoPlayer versions, you may have to maintain it yourself. Hope this helps.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Kevin W Palmer avatar image
Kevin W Palmer answered
Question answered. Thank you!
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.