Recently in the video playback of the application system MPMoviePlayerController player to play video, found that the click Fast Forward rewind will appear black screen phenomenon, and click the Finish button will not return, the code and the interface is as follows:
Nsurl *url=[self Getnetworkurl]; _movieplayer=[[mpmovieplayercontroller Alloc]initwithcontenturl:url]; _movieplayer.view.frame=cgrectmake (0, 0, kscreenwidth, kscreenheight); _movieplayer.controlstyle = Mpmoviecontrolstylefullscreen; [_movieplayer play]; [Self.view Addsubview:_movieplayer.view];
The effect of the current implementation is to click on Fast Forward rewind and exit the player when finished to return to the previous controller, as follows:
Add listener mode to intercept the click events of these buttons, the code is as follows
listening [[Nsnotificationcenter defaultcenter]addobserver:self selector: @selector (movieplaybackdidfinish:) Name: Mpmovieplayerplaybackdidfinishnotification object:nil];//Implementation Return interface-(void) Movieplaybackdidfinish: (NSNotification*) notification{ [[Nsnotificationcenter defaultcenter] removeobserver:self Name: Mpmovieplayerplaybackdidfinishnotification Object:nil]; [_movieplayer stop]; [Self Dismissviewcontrolleranimated:yes completion:nil]; }
This basically can play the video normally, but the test found that when the video played a few seconds after the click on the Rewind button, will not exit the video interface but back to the beginning of the video playback, and if just play the video click the Rewind button will exit the playback interface, and the fast-forward button does not exist this problem. No good solution has been found yet, and if any of the great gods have solved this problem, please enlighten me.
iOS system video player MPMoviePlayerController application encounters the Pit