Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I had the same problem, but with loading a video from a url (on the web)</p> <p>Previously I:</p> <ol> <li>Subscribed for <code>MPMoviePlayerPlaybackDidFinishNotification</code> notifications</li> <li>Initialized a <code>MPMoviePlayerViewController</code> (no content url at this stage)</li> <li>Presented it via <code>presentMoviePlayerViewControllerAnimated</code>:</li> <li>While it was up on screen, I loaded the streamed url (asynchronously)</li> <li>When the url came back, I would set the content url on the <code>MPMoviePlayerViewController</code>' moviePlayer</li> </ol> <p>As you said, occasionally the <code>MPMoviePlayerViewController</code> would get stuck and wouldn't dismiss itself when the user taps exit, to fix this, I changed my autoplay order, so the flow became:</p> <ol> <li>Subscribed for <code>MPMoviePlayerPlaybackDidFinishNotification</code> notifications</li> <li>Initialized a <code>MPMoviePlayerViewController</code> (no content url at this stage)</li> <li><strong>Set the moviePlayer's <code>shouldAutoplay</code> boolean to NO</strong></li> <li>Presented it via <code>presentMoviePlayerViewControllerAnimated</code>:</li> <li>While it was up on screen, I loaded the streamed url (asynchronously)</li> <li>When the url came back, I would set the content url on the <code>MPMoviePlayerViewController</code>' moviePlayer</li> <li><strong>Set the moviePlayer's <code>shouldAutoplay</code> boolean to YES</strong></li> </ol> <p>Since those two changes, I have yet to see the controller get <em>stuck</em></p>
 

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