Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You only need to give the URL of the movie file and the streams will automatically be setup according to the speed of your connection. </p> <p>Mind you, only those videos whose resolution is within iPhone's limits will get played. Higher resolution movies will get played on Simulator but will not work on iPhone. </p> <p>You need to have an object of <code>MPMoviePlayerController</code> and the rest of the code is like this: </p> <pre><code>-(void) play { NSURL *movieURL = [NSURL URLWithString:@"http://movies.apple.com/media/us/mac/getamac/2009/apple-mvp-biohazard_suit-us-20090419_480x272.mov"]; if (movieURL != nil) { moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:movieURL]; moviePlayer.initialPlaybackTime = -1.0; // Register to receive a notification when the movie has finished playing. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerScalingModeDidChangeNotification object:moviePlayer]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(endPlay:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer]; moviePlayer.scalingMode = MPMovieScalingModeAspectFit; moviePlayer.movieControlMode = MPMovieControlModeDefault; moviePlayer.backgroundColor = [UIColor blackColor]; [moviePlayer play]; } } -(void)moviePlayBackDidFinish: (NSNotification*)notification { self.navigationItem.hidesBackButton = FALSE; moviePlayer = [notification object]; [moviePlayer play]; } -(void)endPlay: (NSNotification*)notification { NSLog(@"end Playing"); self.navigationItem.hidesBackButton = FALSE; //[[UIApplication sharedApplication] endIgnoringInteractionEvents]; [actview stopAnimating]; [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerScalingModeDidChangeNotification object:moviePlayer]; [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer]; [moviePlayer stop]; [moviePlayer release]; } </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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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