Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing bitrate of Exo Player

This question might have been asked many times. I searched everywhere but could not find the correct answer. I am using ExoPlayer in my project to play HLS videos.

I want to give user the option to select the bandwidth of videos. Something like what YouTube does.Any idea how this can be achieved using ExoPlayer?

like image 732
prit Avatar asked May 30 '16 11:05

prit


1 Answers

From ExoPlayer issue tracker:

ExoPlayer currently selects the first variant listed in the master playlist. If I remember correctly, this is what Apple recommends/specifies as correct client behavior. If you want to start in the lowest quality, you should technically have your server generate the master playlist with the lowest quality listed first.

The above aside, we do agree that it makes more sense for the client to make the initial variant selection locally, as opposed to the recommended behavior. We'll be moving HLS over to use FormatEvaluator in ExoPlayer V2, which will give more control over the initial selection (and over the adaptive algorithm in general).

And as the solution, this comment:

Have a look at AdaptiveTrackSelection.Factory. Its parameters may provide enough customization for your case.

I think this should give you either the answer you need, or it will guide you in the right direction.

Note that you have to provide streams in lower qualities to be able to use this. If you ONLY have the video in HD, ExoPlayer can't downsample the video, its not its job and not what it is intended for. ExoPlayer can only sync and enable smooth transition between the video in multiple resolutions when they are provided.

like image 90
Chapz Avatar answered Nov 14 '22 14:11

Chapz