Note that there are some explanatory texts on larger screens.

plurals
  1. POiPad videoPlayerDidFinishPlaying callback method not responding
    primarykey
    data
    text
    <p>I am facing a problem in ipad video incorporating. My code works fine I mean it plays the video, but once the video reaches to its end. The callback method is not called.</p> <p>This method is called when play video button is pressed.</p> <pre><code>-(IBAction) playVideo : (id) sender { [self initPlayingVideo:@"toyVid.mp4"]; } </code></pre> <p>This method handles the playing of video.</p> <pre><code>-(void) initPlayingVideo: (NSString *) videoFile { NSString *moviePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:videoFile]; theMovie = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL fileURLWithPath:moviePath]]; theMovie.moviePlayer.scalingMode = MPMovieScalingModeAspectFit; theMovie.moviePlayer.controlStyle = MPMovieControlStyleFullscreen; [self.view addSubview:theMovie.view]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(videoPlayerDidFinishPlaying name:MPMoviePlayerPlaybackDidFinishNotification object:theMovie]; videoPlayer = [theMovie moviePlayer]; [videoPlayer play]; } </code></pre> <p>This is the callback method.</p> <pre><code>-(void) videoPlayerDidFinishPlaying: (NSNotification*)aNotification { theMovie = [aNotification object]; [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:theMovie.moviePlayer]; [videoPlayer stop]; [theMovie.moviePlayer release]; [videoPlayer release]; [theMovie.view removeFromSuperview]; } </code></pre> <p>Where I am doing mistake? Please guide.</p> <p>Regards Ranjan</p>
    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.
 

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