I've achieved detecting the click of prev/next button by following code, but still haven't found an way to distinguish the two clicks.
in @implementation MyMovieController : MPMoviePlayerController
[[NSNotificationCenter defaultCenter]
addObserver:self selector:@selector(movieChangeCallBack:)
name:MPMoviePlayerPlaybackStateDidChangeNotification object:nil];
and define - (void) movieChangeCallBack:(NSNotification*) aNotification
- (void)movieChangeCallBack:(NSNotification*) aNotification {
if (self.playbackState == MPMoviePlaybackStateStopped)
{
//Touched 'Previous' or 'Next' button.
}
}
Is there a way to tell whether the 'previous' or 'next' button is clicked? Thanks :)
Unfortunately,
MPMoviePlayerController, by default, fires offMPMoviePlayerPlaybackStateDidChangeNotificationwhen either the Prev or Next is tapped. There's no way to uniquely be notified whether each one is tapped.The only way I found, was to create my own custom controls for backward and forward, adding a target to it to perform an action:
Then in your
onClickmethod:FYI: you must set the player's
controlStyleproperty toMPMovieControlStyleNonto hide the default controls.