Search code examples
iosexceptioncrashmpmovieplayercontroller

Assertion failure in -[MPMoviePlayerControllerNew _moviePlayerDidBecomeActiveNotification:]


I'm using multiple instances of MPMoviePlayerController,
Which does not allow playing more than one video at a time (On different instances of course)

In order not to play two instances at the same time, i stop and dismiss previous player once a new one is playing.

After plying a few videos, it throws an exception which i can't catch because it caused by internal notifications sent between instances.


Solution

  • It seems that calling 'stop' method to a player which has loadState == MPMovieLoadStateUnknown, causes bad internal state and throws the exception.

    So, the solution was not to allow stopping a player in that state (A player has this state for about a second when it initializes playback).

    Here's a reference to the very helpful mail chain that helped me find it