Reputation: 1522
I am using the code below to attempt to play a video in my iPhone app. However, I don't understand why it doesn't work.
NSURL *url = [NSURL fileURLWithPath:filePath];
MPMoviePlayerController* moviePlayer = [[[MPMoviePlayerController alloc] initWithContentURL:url] autorelease];
moviePlayer.controlStyle = MPMovieControlStyleDefault;
moviePlayer.shouldAutoplay = YES;
[self.view addSubview:moviePlayer.view];
[moviePlayer setFullscreen:YES animated:YES];
Upvotes: 0
Views: 196