dhaya
dhaya

Reputation: 1522

Playing video in my iPhone application (MPMoviePlayer)

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

Answers (1)

DivineDesert
DivineDesert

Reputation: 6954

Where is your play statement ??

[moviePlayer play];

Upvotes: 1

Related Questions