Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Kindly find my full Code about this , it's working with me </p> <p>add .h class add this </p> <pre><code>@property(strong,nonatomic) MPMoviePlayerViewController * moviePlayer; </code></pre> <p>at .m class add this code "pass the movie URl"</p> <pre><code>-(void) playMovie:(NSString *)filePath { NSURL *theOutputURL = [NSURL fileURLWithPath:filePath]; if(_moviePlayer) [_moviePlayer.moviePlayer setContentURL:theOutputURL]; else _moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:theOutputURL]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myMovieFinishedCallback:) name:MPMoviePlayerPlaybackDidFinishNotification object:_moviePlayer.moviePlayer]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerPlaybackStateDidChange:) name:MPMoviePlayerPlaybackStateDidChangeNotification object:_moviePlayer.moviePlayer]; if (![_moviePlayer.moviePlayer isPreparedToPlay]) [_moviePlayer.moviePlayer prepareToPlay]; _moviePlayer.moviePlayer.movieSourceType = MPMovieSourceTypeFile; [_moviePlayer.moviePlayer setFullscreen:YES]; _moviePlayer.moviePlayer.controlStyle=MPMovieControlStyleEmbedded; [_moviePlayer.moviePlayer setContentURL:theOutputURL]; _moviePlayer.view.frame = CGRectMake(0, 0, [[UIScreen mainScreen]bounds].size.width, [[UIScreen mainScreen]bounds].size.height); [_moviePlayer shouldAutorotateToInterfaceOrientation: AVCaptureVideoOrientationLandscapeRight]; [self.view addSubview:_moviePlayer.view]; } - (void) moviePlayerPlaybackStateDidChange: (NSNotification *) notification { if (_moviePlayer.moviePlayer.playbackState == MPMoviePlaybackStateStopped) { [_moviePlayer.moviePlayer setContentURL:[_moviePlayer.moviePlayer contentURL]]; [_moviePlayer.moviePlayer play]; } } -(void)myMovieFinishedCallback:(NSNotification*)aNotification { // to add your code after playback is finished } </code></pre>
 

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