Search code examples
iosstreamingavplayer

iOS AVPlayer cancel buffering


If I load an AVPlayer 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?


Solution

  • 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!