开发者

MPMoviePlayerViewController notifications

How to set notifications to MPMoviePlayerViewController? Is it the same as in MPMoviePla开发者_运维问答yerController?

Show example please


The MPMoviePlayerViewController is just a wrapper giving you controls to a MPMoviePlayerController.

MPMoviePlayerViewController has its own MPMoviePlayerController that sends all the notifications you need to work with it.

Listening to notifications is done as follows:

// 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

There are a lot more notifications you can and should work with that are listed in the MPMoviePlayerController Class Reference

So basically, yes - You can use the same notifications as in MPMoviePlayerController

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜