justdan0227 justdan0227 - 3 years ago 278
iOS Question

iOS AVPlayer cancel buffering

If I load an

with a file from a host with

[AVPlayer playerWithPlayerItem:playerItem];

And the "buffering" takes longer than the user wants, how do I allow them to cancel it?

Answer Source

So the correct answer is @Che with:

If you will call [self.player replaceCurrentItemWithPlayerItem:nil]; buffering stops. – Che Oct 13 at 14:36

and you do so on the observer listening for the status update from the playerWithPlayerItem. Thanks All!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download