【发布时间】:2014-12-05 10:48:54
【问题描述】:
我正在使用自定义 MPMoviePlayerViewController。 如下所示,
#import <MediaPlayer/MediaPlayer.h>
@interface customVideoViewController : MPMoviePlayerViewController
{
}
@end
我正在从其他类调用此 customVideoViewController 类以横向模式连续运行我的视频,视频运行良好,但我无法捕捉 MPMoviePlayerViewController 的 DONE 按钮的 onClick 动作。
谁能指导我。
这就是我调用这个视图的方式。
customVideoPlayerObj = [[customVideoViewController alloc]initWithContentURL:self.url];
[self presentViewController:customVideoPlayerObj animated:YES completion:nil];
[customVideoPlayerObj.moviePlayer play];
我需要捕捉点击完成按钮的动作,如何做到这一点...?
这是相同的观察者
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(doneButtonClick:)
name:MPMoviePlayerWillExitFullscreenNotification
object:customVideoPlayerObj];
但控制权没有进入doneButtonClick
【问题讨论】:
-
您在哪种方法中添加通知观察者?
-
@Michael Dautermann 使用与我调用此方法相同的方法。我也尝试在 customVideoViewController 文件中添加观察者,但没有帮助
标签: xcode mpmovieplayercontroller