繁体   English   中英

MPMoviePlayerViewController通知

[英]MPMoviePlayerViewController notifications

如何设置MPMoviePlayerViewController的通知? 它与MPMoviePlayerController中的相同吗?

请显示示例

MPMoviePlayer 视图控制器只是一个包装器,为您提供MPMoviePlayerController的控件。

MPMoviePlayerViewController有自己的MPMoviePlayerController ,可以发送使用它所需的所有通知。

收听通知的过程如下:

// Register for the playback finished notification
[[NSNotificationCenter defaultCenter] addObserver:self // the object listening / "observing" to the notification
    selector:@selector(myMovieFinishedCallback:) // method to call when the notification was pushed
    name:MPMoviePlayerPlaybackDidFinishNotification // notification the observer should listen to
    object:self.moviePlayerViewController.moviePlayer]; // the object that is passed to the method

MPMoviePlayerController Class Reference中列出了很多可以和应该使用的通知

所以基本上,是的 - 您可以使用与MPMoviePlayerController相同的通知

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM