0

Here's the user story for this simple iPhone App:

The user clicks on the thumbnail and triggers the MPMoviePlayerViewController to play the online video (in full screen).

We know that after the video finishes it would automatically shut down the player, then return to the previous page.

I need: return to another scene, not the previous one with the thumbnail.

Is there anybody who could offer some help? Thank you very much ahead of time.

4

1 回答 1

0

侦听 MPMoviePlayerPlaybackDidFinishNotification 通知,然后将新的视图控制器推送到堆栈中。

有关该通知和电影播放器​​视图控制器的更多信息,请访问此处:http: //developer.apple.com/library/ios/documentation/mediaplayer/reference/MPMoviePlayerController_Class/Reference/Reference.html

编辑 - 添加如何收听通知......

以下是收听通知的方法:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playerPlaybackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:self.player];

其中 self.player 是电影播放器​​实例,而 playerPlaybackDidFinish 是您定义的用于处理回调的方法 :)

于 2012-07-20T16:31:10.333 回答