vinylDeveloper
vinylDeveloper

Reputation: 707

No UI controls for MPMoviePlayerController

I'm trying to add a video that I pull from my server do play in my app.

The video plays now, but I don't have any UI controls for volume. fullscreen etc.

Can any one help? Here is my code

NSURL *url = [NSURL URLWithString:@"http://www.gzerodesign.com/sharksclips/video.mp4"];
    moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];

    // Register to receive a notification when the movie has finished playing.
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(moviePlayBackDidFinish:)
                                                 name:MPMoviePlayerPlaybackDidFinishNotification
                                               object:moviePlayer];

    if ([moviePlayer respondsToSelector:@selector(setFullscreen:animated:)]) {
        // Use the new 3.2 style API
        moviePlayer.controlStyle = MPMovieControlModeDefault;
        moviePlayer.shouldAutoplay = YES;
        [[moviePlayer view] setFrame:[[self view] bounds]];
        [self.view addSubview:moviePlayer.view];
        [moviePlayer setFullscreen:YES animated:YES];
        [moviePlayer play]; 
    } else {
        // Use the old 2.0 style API
        moviePlayer.movieControlMode = MPMovieControlModeHidden;
        [moviePlayer play];  
    }  

Upvotes: 0

Views: 1958

Answers (2)

Vishal
Vishal

Reputation: 8256

Delete this line in your code:

moviePlayer.controlStyle = MPMovieControlModeDefault;

& also this line:

moviePlayer.movieControlMode = MPMovieControlModeHidden;

& then check.

Upvotes: 0

shingo.nakanishi
shingo.nakanishi

Reputation: 2837

I only have experience the New 3.2 style API.

moviePlayer.controlStyle = MPMovieControlModeDefault;

comment out

// moviePlayer.controlStyle = MPMovieControlModeDefault;

you may be have fullscreen button and skip button. but not show volume.

I did not try but, I search this.

MPMoviePlayerViewController not showing volume slider?

Upvotes: 1

Related Questions