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];
}
We can also able to play files with .3gp extension, but to play we need some compression standards for that converted the file into all mobile supported formats means (3GPP - Mobile Balanced Quality [H.263 near 128 kbps, 10 fps, 128*96; AMR)). So it is playing now.