2

In my application i am using MPMoviePlayerController for playing the video.I want to take the event when the user trying to skip the movie(track the progressbar).

before that just clarify my doubt,is there a possibility to getting the event when the user trying to skip the video(track the progressbar).

Thank You:)

mareeswaran
  • 227
  • 2
  • 9

2 Answers2

2

there are many notifications defined for MPMoviePlayerController

// Posted when the scaling mode changes.

MP_EXTERN NSString *const MPMoviePlayerScalingModeDidChangeNotification;

// Posted when movie playback ends or a user exits playback.
MP_EXTERN NSString *const MPMoviePlayerPlaybackDidFinishNotification;

MP_EXTERN NSString *const MPMoviePlayerPlaybackDidFinishReasonUserInfoKey NS_AVAILABLE_IPHONE(3_2); // NSNumber (MPMovieFinishReason)

// Posted when the playback state changes, either programatically or by the user.
MP_EXTERN NSString *const MPMoviePlayerPlaybackStateDidChangeNotification NS_AVAILABLE_IPHONE(3_2);

// Posted when the network load state changes.
MP_EXTERN NSString *const MPMoviePlayerLoadStateDidChangeNotification NS_AVAILABLE_IPHONE(3_2);

// Posted when the currently playing movie changes.
MP_EXTERN NSString *const MPMoviePlayerNowPlayingMovieDidChangeNotification NS_AVAILABLE_IPHONE(3_2);

// Posted when the movie player enters or exits fullscreen mode.
MP_EXTERN NSString *const MPMoviePlayerWillEnterFullscreenNotification NS_AVAILABLE_IPHONE(3_2);
MP_EXTERN NSString *const MPMoviePlayerDidEnterFullscreenNotification NS_AVAILABLE_IPHONE(3_2);
MP_EXTERN NSString *const MPMoviePlayerWillExitFullscreenNotification NS_AVAILABLE_IPHONE(3_2);
MP_EXTERN NSString *const MPMoviePlayerDidExitFullscreenNotification NS_AVAILABLE_IPHONE(3_2);
MP_EXTERN NSString *const MPMoviePlayerFullscreenAnimationDurationUserInfoKey NS_AVAILABLE_IPHONE(3_2); // NSNumber of double (NSTimeInterval)
MP_EXTERN NSString *const MPMoviePlayerFullscreenAnimationCurveUserInfoKey NS_AVAILABLE_IPHONE(3_2);     // NSNumber of NSUInteger (UIViewAnimationCurve)

which one is you need?

Sabby
  • 2,586
  • 2
  • 27
  • 41
dinosaur
  • 638
  • 5
  • 14
  • you have given all the notification of MPMoviePlayerController.I'm not able to find which one is used for progressbar tracking.could you please tell me the notification of progressbar tracking.Thank you – kanmani Feb 23 '11 at 04:28
  • could you please help me for finding the notification of progressbar tracking – kanmani Feb 23 '11 at 06:14
-1

I have tried and got the answer for this question(notification for progressbar tracking),

CODE:

-(void) moviePlayerPlaybackStateDidChange:(NSNotification*)notification {

NSLog(@"moviePlayerPlaybackStateDidChange");
MPMoviePlayerController *moviePlayer = notification.object;
MPMoviePlaybackState playbackState = moviePlayer.playbackState;
if(playbackState == MPMoviePlaybackStateStopped)
{
    NSLog(@"MPMoviePlaybackStateStopped");
} 
if(playbackState == MPMoviePlaybackStatePlaying) 
{
    NSLog(@"MPMoviePlaybackStatePlaying");
} 
if(playbackState == MPMoviePlaybackStatePaused)
{
    NSLog(@"MPMoviePlaybackStatePaused");
} 
if(playbackState == MPMoviePlaybackStateInterrupted) 
{
    NSLog(@"MPMoviePlaybackStateInterrupted");
} 
if(playbackState == MPMoviePlaybackStateSeekingForward)
{
    NSLog(@"MPMoviePlaybackStateSeekingForward");
} 
if(playbackState == MPMoviePlaybackStateSeekingBackward)
{
    NSLog(@"MPMoviePlaybackStateSeekingBackward********");
}

}

kanmani
  • 671
  • 1
  • 10
  • 28