Thanks in advance. I want to implement the code to play a video in iphone programatically from URL. I have written the code like this .
NSURL *url = [NSURL
I have played successfully .3gp with iphone sdk and my code is :
NSString *soundLocalPath = [[NSBundle mainBundle] pathForResource:@"Demo_video" ofType:@"3gp"];
NSURL *tempUrl = [NSURL fileURLWithPath:soundLocalPath];
self.soundUrlPath = tempUrl;
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL: self.soundUrlPath];
self.mpMoviePlayer = player;
[player release];
[self.mpMoviePlayer prepareToPlay];
[self.mpMoviePlayer.view setFrame: self.view.bounds]; // player's frame must match parent's
[self.view addSubview: self.mpMoviePlayer.view];
[self.mpMoviePlayer play];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(movieFinishedCallback:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:player];
-(void) movieFinishedCallback:(NSNotification*) aNotification
{
MPMoviePlayerController *player = [aNotification object];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:player];
[player autorelease];
}