Aijaz Ali
Aijaz Ali

Reputation: 393

how to show MPMoviePlayer done button when video is playing?

I want to play video in MPMoviePlayerViewController, it works fine and plays video but problem is that it does not show done button unless i switch to the full screen mode. It should automatically show player along with done button as shown in attached screen.enter image description here

here is the code:

   mp = [[MPMoviePlayerViewController alloc] initWithContentURL:myURL];
    [[mp moviePlayer] prepareToPlay];
    [[mp moviePlayer] setUseApplicationAudioSession:NO];
    [[mp moviePlayer] setShouldAutoplay:YES];
    [[mp moviePlayer] setControlStyle:2];
    [self presentMoviePlayerViewControllerAnimated:mp];

Upvotes: 0

Views: 834

Answers (2)

payal
payal

Reputation: 162

Done button visible you set the ControlStyle.

[player.moviePlayer setControlStyle:MPMovieControlStyleFullscreen];
[player.moviePlayer setFullscreen:NO animated:YES];

Upvotes: 0

Vinay Jain
Vinay Jain

Reputation: 2634

Done button will be visible only when video is played in full screen mode. So, either you need to play the video in full screen mode using the following code:

player.moviePlayer.fullscreen = YES;

Or you need to customise the control to add your own Done button.

Upvotes: 1

Related Questions