Note that there are some explanatory texts on larger screens.

plurals
  1. POMPMoviePlayerController will not automatically dismiss movie after finish playing (ios 6)
    primarykey
    data
    text
    <p>I may not have worded my title very well, maybe more correct to say my NSNotification isn't dismissing my movie's view after it's done playing. I've found others with this problem but no solutions, seems like it might be a problem with iOS 6 which is what I'm running.</p> <p>After the video is done playing, you need to press "Done" to dismiss but I want it to dismiss automatically since I will be using MPMovieControlStyleNone once I get this sorted out. Here's my code with the unused sections stripped out: `</p> <pre><code>#import "MovieViewController.h" @interface MovieViewController () @end @implementation MovieViewController @synthesize moviePlayer = _moviePlayer; - (IBAction)playMovie:(id)sender { NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"TestMovie" ofType:@"mov"]]; _moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:_moviePlayer]; _moviePlayer.controlStyle = MPMovieControlStyleDefault; _moviePlayer.shouldAutoplay = YES; [self.view addSubview:_moviePlayer.view]; [_moviePlayer setFullscreen:YES animated:NO]; } - (void) moviePlayBackDidFinish:(NSNotification*)notification { MPMoviePlayerController *player = [notification object]; [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:player]; if ([player respondsToSelector:@selector(setFullscreen:animated:)]) { [player.view removeFromSuperview]; } } @end` </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
 

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