avplayer manual bitrate control

Hi ,


I am working on a custom player where I have to give an option for bitrate switching.

This can be done by dynamically modifying the master playlist at the app level and resetting the player with new master manifest and seeking to the actual position. But this will completely reset the player item and not the optimal way.

Second approach, using preferredPeakBitRate. This will work but it takes time to switch to the selected bitrate and also this will not quarantee that player will play in the selected bitrate.

Can someone suggest which is the best/right approach to implement manual bitrate switch control.Expectation is player should switch immediatly.

Replies

You are trying to make the system do something it was not designed to do.

If you are using the iOS playback of an HLS video then, you don't get any manual control. Period.

Hi sw_mechanic,


Thanks for the reply. Yes, I am working on HLS video. Basically I have to provide an interface to control the playback bitrate. with "preferredPeakBitRate" sometimes it wont work, I have seen this in chalres log session. It keeps on playing in the same bitrate though the value of preferred bitrate has changed.

I am aware that AVFoundation doesnt provide any direct api's to implement this feature, and also somethird party players have implemented this with native avplayer.


It would be helpfull if you guide me in implementing this feature, on the apis level. May be I am not aware of it since third party players are able to achieve this feature in their sdk.


Thanks,

Santhosh

I'm also in similar situation.

Sometimes, I can handle initial bitrate with changing master playlist and I can choose lower bitrate with preferredPeakBitrate.

But I cannot choose more higher bitrate than current bitrate.

In my case, when my app entered in background, I choose minimum bitrate with preferredPeakBitrate.

However, I cannot return to a higer bitrate when I returned to foreground.

Is there any way to choose a higher bitrate?


Thanks.

So far as I am aware setting preferredPeakBitrate should allow switching up.

Based on conditions it may not switch up immediately.

If you believe lowering and then raising preferredPeakBitrate does not work then try to create a repeatable test case and submit a bug.

I want to implement manual bitrate control.In the master playlist,I can get several bandwidth.Setting the preferredPeakBitRate which is AVPlayerItem's property dose not work. How can I switch the bandwidth? Thanks a million!

Hello.How can I initial bitrate with changing master playlist?