I'm using this to play a local .mov file
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle]
pathForResource:@"MOVIE" ofType:@"mov"]];
moviePlayer =
[[MPMoviePlayerController alloc]
initWithContentURL:url];
[moviePlayer setControlStyle:MPMovieControlStyleNone];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector( moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:moviePlayer];
[moviePlayer setScalingMode:MPMovieScalingModeAspectFill];
[moviePlayer setFullscreen:FALSE];
//---play partial screen---
moviePlayer.view.frame = CGRectMake(0, 0, 320, 240);
moviePlayer.shouldAutoplay = YES;
[self.view addSubview:moviePlayer.view];
[moviePlayer play];
I'd like to pre-load a video from a url and save it to the drive, so that there is no network lag while it is playing. How can I save the file from the url and then load it into the mpmovieplayer.
It seems like it must be something like this...
NSString *stringURL = @"url to file";
NSURL *url = [NSURL URLWithString:stringURL];
NSData *urlData = [NSData dataWithContentsOfURL:url];
but I don't know how to initialize it with the data if this is the case.