完成MPMoviePlayerViewController的按钮操作

时间:2014-12-05 10:48:54

标签: xcode mpmovieplayercontroller

我正在使用自定义MPMoviePlayerViewController。 如下所示,

#import <MediaPlayer/MediaPlayer.h>

@interface customVideoViewController : MPMoviePlayerViewController
{
}

@end

我从其他类调用此customVideoViewController类以横向模式串行运行我的视频,视频运行正常,但我无法捕捉到MPMoviePlayerViewController的DONE按钮上的动作。

任何人都可以指导我。

这就是我打电话给这个观点的方式。

customVideoPlayerObj = [[customVideoViewController alloc]initWithContentURL:self.url];
[self presentViewController:customVideoPlayerObj animated:YES completion:nil];
[customVideoPlayerObj.moviePlayer play];

我需要抓住DONE按钮的动作点击这个,怎么做......?

这是相同的观察者

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

但是控件不会进入doneButtonClick

2 个答案:

答案 0 :(得分:1)

MPMoviePlayerWillExitFullscreenNotification和MPMoviePlayerDidExitFullscreenNotification在电影播放器​​退出全屏时触发。

答案 1 :(得分:-1)

您可以使用 MPMoviePlayerPlaybackDidFinishNotification

相关问题