Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I got the same error when using a multitask gesture (4 finger swipe) with an instance of MPMoviePlayerViewController open in fullScreen. This caused the app to crash hard, disabling the iPad from rotating and killing the iPad eventually.</p> <p>It appears that the cause of this is largely due to not having your .plist file set up properly.</p> <ol> <li>Open your .plist file and find the key "Required background modes" (if you are showing the raw key values, it's is called "UIBackgroundModes").</li> <li>Open the dropdown for "Required background modes" and click into "Item 0" (or add a new row there)</li> <li>In the "Value" column, enter "App plays audio" (you can see it in the dropdown menu if you click the arrows by the add row plus sign</li> </ol> <p>Once you do that, you shouldn't receive that error again.</p> <p>//EDIT As long as the app doesn't need to play the video and audio while you're somewhere else in your app or another app, you probably don't want to keep that video streaming and eating those resources. So add and check that "Application does not run in background" box in your .plist.</p> <p>As for the playback, there are a lot of thinks that can happen during playback that can crash the app and device. Add this method before the method that opens your MPMoviePlayerController:</p> <pre><code>- (void) moviePlayerPlaybackStateDidChange: (NSNotification *) notification { if (movplayer.playbackState == MPMoviePlaybackStateStopped) { [movplayer setContentURL:[movplayer contentURL]]; [movplayer play]; } } </code></pre> <p>Then add this observer in the method that calls your MPMoviePlayerController:</p> <pre><code>[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerPlaybackStateDidChange:) name:MPMoviePlayerPlaybackStateDidChangeNotification object:nil]; </code></pre> <p>This will catch a change, like the video player finishing, or fast forwarding to the end of the video, and reset the video to the beginning if iOS doesn't like something. It's helpful to manage these kind of errors/crashes that happen with the player.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload