drbj
drbj

Reputation: 115

Can't click controls on my MPMoviePlayerViewController

I am playing a url on my MPMoviePlayerViewController. And I can't click any controls of the player.

Here's my implementation:

  NSURL *streamUrl   = [NSURL URLWithString:movieUrl];
    MPMoviePlayerViewController *mpvc = [[MPMoviePlayerViewController alloc] initWithContentURL:streamUrl];
    [[mpvc view] setFrame:self.view.bounds];
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(movieFinishedCallback:)
                                                 name:MPMoviePlayerPlaybackDidFinishNotification
                                               object:nil];

    mpvc.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
    [mpvc.moviePlayer setControlStyle:MPMovieControlStyleFullscreen];
    [mpvc.moviePlayer setShouldAutoplay:YES];
    [mpvc.moviePlayer setFullscreen:NO animated:YES];
    [mpvc setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
    [mpvc.moviePlayer setScalingMode:MPMovieScalingModeNone];
    [mpvc.moviePlayer setUseApplicationAudioSession:NO];
    [self presentMoviePlayerViewControllerAnimated:mpvc];

MPMoviePlayerViewController

Upvotes: 1

Views: 64

Answers (1)

drbj
drbj

Reputation: 115

Fixed it by calling my method with performSelectorOnMainThread

Upvotes: 1

Related Questions