0

I have an mp4 file called lebron.mp4 in my Resources folder:

-(IBAction)videoButtonClicked:(id)sender{
    NSString *url = [[NSBundle mainBundle] 
                     pathForResource:@"lebron" 
                     ofType:@"mp4"];

    MPMoviePlayerViewController* moviePlayerViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:url]];

    moviePlayerViewController.view.backgroundColor = [UIColor blackColor];
    [self presentMoviePlayerViewControllerAnimated:moviePlayerViewController];

    [moviePlayerViewController release];    
}

Displays the movie player, but the movie doesn't play. Why?

1 Answer 1

0

did you try to display it like this :

[moviePlayerViewController play];
[window addSubview: MPMoviePlayerViewController.view];

?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.