Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I know, it's a little outdated, but anyway. I did some research in that direction, and looks like a found an answer. I do not know, why it's working, but it is.</p> <pre><code>-(void) playMovieAtURL: (NSURL*) theURL { MPMoviePlayerController* theMovie = [[MPMoviePlayerController alloc] initWithContentURL: theURL]; //That line is for ARC. Without it, it may not work. self.moviePlayer = theMovie; theMovie.scalingMode = MPMovieScalingModeAspectFill; theMovie.controlStyle = MPMovieControlStyleFullscreen; theMovie.repeatMode = MPMovieRepeatModeOne; //Here you'd better use your custom ViewController subclass, if you want autorotating and all that stuff. UIViewController * vc = [UIViewController new]; [vc.view addSubview:theMovie.view]; theMovie.fullscreen = YES; theMovie.view.frame = vc.view.bounds; vc.view = theMovie.view; [self presentModalViewController:vc animated:YES]; theMovie.fullscreen = YES; [theMovie prepareToPlay]; [theMovie play]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myMovieFinishedCallback:) name:MPMoviePlayerPlaybackDidFinishNotification object:nil]; } </code></pre> <p>// When the movie is done, release the controller.</p> <pre><code>-(void) myMovieFinishedCallback: (NSNotification*) aNotification { [self dismissModalViewControllerAnimated:YES]; MPMoviePlayerController* theMovie = [aNotification object]; [[NSNotificationCenter defaultCenter] removeObserver: self name: MPMoviePlayerPlaybackDidFinishNotification object: theMovie]; [self.moviePlayer.view removeFromSuperview]; self.moviePlayer = nil; // Release the movie instance created in playMovieAtURL: } </code></pre>
    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.
    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