0

I am trying to find out what I can do with an iPad as far as playing back video is concerned. And I have the following code for a UIButton action.

- (IBAction)playClick:(id)sender {
NSBundle *bundle = [NSBundle mainBundle];
NSString *moviePath = [bundle pathForResource:@"video3" ofType:@"m4v"];
NSURL  *movieURL = [NSURL fileURLWithPath:moviePath];
MPMoviePlayerController *theMovie = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
theMovie.scalingMode = MPMovieScalingModeAspectFill;
[theMovie play];
MPMoviePlayerViewController *moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:movieURL];
[self presentMoviePlayerViewControllerAnimated:moviePlayer];
}

video

As shown above, I do get a movie screen. I wonder if it's possible to include a navigation bar at the top (above 'Done') or the bottom (below the controller) of the movie screen so that I can add some actions while the user plays back video? I guess this topic may concern what I'm trying to do.

Thank you for your help.

Community
  • 1
  • 1
El Tomato
  • 6,479
  • 6
  • 46
  • 75
  • 1
    the navigation bar is already there right!!do you mean that you need to add more button items?? – DD_ Jan 20 '13 at 08:15

1 Answers1

0

You can add more buttons using,

UIBarButtonItem *button = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(yourButtonAction:)]; 
moviePlayer.navigationItem.rightBarButtonItem = button; 

Customize these buttons as per your need.

Try this .Hope that make sense.

regards

DD_
  • 7,230
  • 11
  • 38
  • 59
  • Thanks. In fact, I have tried that, following tips available with 'this topic.' But a button besides Done never appears. – El Tomato Jan 20 '13 at 10:58
  • I guess the following web site has an example with sharedApplication. http://sugartin.info/2011/09/07/creating-customized-movieplayer-in-iphone-ipad-both/ – El Tomato Jan 20 '13 at 11:37