views:

85

answers:

1

Hi, I am using a MpMoviePlayerController To play video in my aap. I want to handle the notification sent by tapping the control button displayed in the red circle in below image.

alt text

Can any one help me out which notification does this control button fires???

UPdates: I tried it in this way,

NSString * filePath = [[NSBundle mainBundle] pathForResource:@"Movie" ofType:@"m4v"];
NSURL *url = [NSURL fileURLWithPath:filePath];
self.player = [[[MPMoviePlayerViewController alloc] initWithContentURL:url] autorelease];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(movieDidExitFullScreen:)
                                             name:MPMoviePlayerDidExitFullscreenNotification
                                           object:self.player.moviePlayer];
[self.window addSubview:self.player.view];

And the functiona in selector is

-(void)movieDidExitFullScreen:(id)sender{

NSLog(@"Movie player did exit full screen");}

But the function never gets called on tapping the control button.

Please let me know if m doing some thing wrong.

Regards,

Nic

A: 

I believe this will generate the MPMoviePlayerScalingModeDidChangeNotification. When you receive the notification, you should check the value of the scalingMode property to determine which scaling mode the player was switched to.

Update:

Looking at the documentation for the MPMoviePlayerController (more specifically, the MPMovieControlStyle enumeration), the button you want to handle seems to be the switch between embedded and full-screen view. This one should generate MPMoviePlayerWillEnterFullscreenNotification (and the corresponding WillExit and DidEnter/DidExit notifications).

Franci Penov
Hi Franci thanks for your reply. I checked it but this control button does not send that notification. "MPMoviePlayerScalingModeDidChangeNotification" notification is sent by the control button at the end of the progress indicator.
Nic