Sheehan Alam
Sheehan Alam

Reputation: 60909

Problem playing video in MPMoviePlayerController for iPad

I can hear audio for about 5 seconds, and then my screen is constantly "Loading Movie..."

I am testing in the simulator.

STVideo *mySTVideo;
    mySTVideo = [items objectAtIndex:indexPath.row];

    moviePlayerViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:mySTVideo.video_url]];

    NSLog(@"URL: %@", mySTVideo.video_url);

    moviePlayerViewController.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"st-screen.png"]];
    [self presentMoviePlayerViewControllerAnimated:moviePlayerViewController];

    [moviePlayerViewController release];

Upvotes: 0

Views: 2418

Answers (2)

Bruno Domingues
Bruno Domingues

Reputation: 1015

I think presentMoviePlayerViewControllerAnimated: doesn't retain the moviePlayer and you are releasing it in the next line. Try deleting the release line and see if it works, if it does create a property to retain the moviePlayer and skip the leak.

Upvotes: 0

Related Questions