开发者

how to get done button event in MPMOviewplayercontroller in iphone?

I have used MPMoviePlayerContro开发者_StackOverflowller for playing video file.I want to get done button event but i dont know how to get can you help me for this questions


You can use MPMoviePlayerPlaybackDidFinishNotification.. Dont think there is a notification that only triggers when the done button is pressed and not when the movie finishes by itself thou...

Add this when creating the MPmovieplayerController:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish: ) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer] ;

And then this method:

-(void)moviePlayBackDidFinish: (NSNotification*)notification{ 
[[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer] ;


[moviePlayer stop]; 
[moviePlayer release];

}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜