iOS system video player MPMoviePlayerController application encounters the Pit

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.