multimedia - iPhone Dev: MediaPlayer not playing video (only audio) on subsequent plays -
I am working on an iPhone application that uses a media player to play some different video. It works very well for the first video, but when I want to play second, the screen is black and only audio plays. Do anyone have any idea why this can happen?
This is my code:
- movieURL {NSBundle * bundle = [NSBundle mainBundle]; If (bundle) {NSString * moviePath = [Bundle Pathfound RSOrs: vidName ofType: @ "mov"]; If (moviepath) mMovieURL = [NSUr file URLWithPath: MoviePath]; If (vidName == @ "Vid01") vidName = @ "Vid02"; Else if (vidName == @ "Vid02") vidName = @ "Vid03"; } Return mMovieURL; } - (zero) onHitButton1 {mMoviePlayer = [[MPMoviePlayerController alloc] initWithContentURL: [self movieURL]]; MMoviePlayer.movieControlMode = MPMovieControlModeHidden; [Mmvplayer play]; }
I thought it. I need to release the media player before calling another video.
Code example:
- (zero) onHitButton1 {[mMoviePlayer release]; MMoviePlayer = [[MP3 MPV Player Controller Alok] initWithContentURL: [Self Movie URL]]; MMoviePlayer.movieControlMode = MPMovieControlModeHidden; [Mmvplayer play]; }
Comments
Post a Comment