Done button event MPMoviePlayerController

前端 未结 7 761
闹比i
闹比i 2020-12-06 09:20

On my iPhone i\'m playing video/audio files in fullscreen mode. When the video/audio file reached its end then the following method is triggered:

- (void) mo         


        
7条回答
  •  时光取名叫无心
    2020-12-06 10:02

    It worked for me on iPad when I listen to MPMoviePlayerWillExitFullscreenNotification.

    [[NSNotificationCenter defaultCenter] addObserver:self 
                                             selector:@selector(doneButtonClick:) 
                                                 name:MPMoviePlayerWillExitFullscreenNotification 
                                               object:nil];
    

    And selector method:

    -(void)doneButtonClick:(NSNotification*)aNotification{
        NSNumber *reason = [notification.userInfo objectForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey];
    
        if ([reason intValue] == MPMovieFinishReasonUserExited) {
            // Your done button action here
        }
    }
    

提交回复
热议问题