0

one small issue in my movieplayer..![movieplayer shows like this]

1: https://i.stack.imgur.com/WujxB.png but i want to show as below screenshotWant to show like this

mycode:

moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];
moviePlayerController.view.frame = CGRectMake(0,0,320,460); 
moviePlayerController.fullscreen = YES; 
[self.view addSubview:moviePlayerController.view]; 
[moviePlayerController play];
Eimantas
  • 48,927
  • 17
  • 132
  • 168
Prajan
  • 666
  • 1
  • 6
  • 15
  • @Stacky:thanx for ur reply..but i'm not grtting u..already i did that all.. setting frame for movieplayer and add that player to my view then what else i want to do – Prajan Jun 21 '11 at 10:31
  • @Stacky:At the first time itself i want to show the movieplayer as second screenshot (i.e.. with done button)remain works well.. – Prajan Jun 21 '11 at 10:32
  • @miamk:moviePlayerController.controlStyle = MPMovieControlStyleEmbedded; now i want to add this code and remove fullscreen property..right? – Prajan Jun 21 '11 at 10:37
  • Actually the above screenshot which is quick time player. – Splendid Jun 21 '11 at 11:08
  • @prasanna:i want to play the video with that only.click on done button it returns to from where i start – Prajan Jun 21 '11 at 11:36
  • By default it would go to where you start when clicks done button if you use quicktime player. – Splendid Jun 21 '11 at 11:47
  • @prasanna:yes prasanna i want the same flow only..but i click on the done button nothing happens with my code.what should i change.plz help me friend – Prajan Jun 21 '11 at 12:33

2 Answers2

2

Those are the default controls for fullscreen playback, since you set moviePlayerController.fullscreen = YES.

The controls you want are for embedded playback, not fullscreen.

What you want is moviePlayerController.controlStyle = MPMovieControlStyleEmbedded; but you can only use it if your movie is embbeded in one of your views. Then you would have the controls that you want, including a toggle between fullscreen and embedded.

MiguelB
  • 1,913
  • 18
  • 20
  • @miamk:moviePlayerController.controlStyle = MPMovieControlStyleEmbedded; now i want to add this code and remove fullscreen property..right? – Prajan Jun 21 '11 at 10:39
  • @Prajan What i mean is that you are always going to have default controls on fullscreen. There's no way to change that. But you can have the controls that you want if your movie is embedded somewhere in a view, keeping in mind that when you hit the fullscreen toggle, the control are going to change to default one. – MiguelB Jun 21 '11 at 10:45
  • @miamk:moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:videoURL]; moviePlayerController.view.backgroundColor=[UIColor blackColor]; moviePlayerController.controlStyle = MPMovieControlStyleFullscreen;moviePlayerController.view.frame = CGRectMake(0,0,320,480); [self.view addSubview:moviePlayerController.view]; [moviePlayerController play]; – Prajan Jun 21 '11 at 10:56
  • @miamk:now i'm changing the code as above.now it showa done button at the first time.All controls are working now except done button. – Prajan Jun 21 '11 at 10:57
  • [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlaybackComplete:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayerController]; – Prajan Jun 21 '11 at 10:58
  • @miamk:the controlnot coming to moviePlaybackComplete this method when done button is clicking – Prajan Jun 21 '11 at 11:00
  • The done button is probably not working because you are not in fullscreen mode anymore. You have set up a frame which is the size of the screen, which is not the same as having fullscreen. You did understand that you can't have those controls on fullscreen, right? – MiguelB Jun 21 '11 at 12:05
  • @miamk:i can't get you.please please give some code.Explain me with simple words please. – Prajan Jun 21 '11 at 12:56
  • @Prajan In the code that you posted in the comment above, try this: instead of `moviePlayerController.controlStyle = MPMovieControlStyleFullscreen`, make it `moviePlayerController.controlStyle = MPMovieControlStyleEmbedded`. The rest of the code looks fine. This way you will have a "fullscreen frame" embedded version of your video with the controls that you want with the option of actually going fullscreen with the default controls. However you must place yourself a back button in the view where your "fullscreen frame" movie is embedded. – MiguelB Jun 21 '11 at 14:02
0

You have to use MPMoviePlayerViewController instead of using MPMoviePlayerController.

Baz
  • 36,440
  • 11
  • 68
  • 94
Ajay Chaudhary
  • 1,993
  • 15
  • 23