I try to play video from dropbox with this URL:http://www.dropbox.com/s/usqbtrjgcxu0ac6/pandaw.m4v but when I play, it become black and I am struck.
Can anyone tell me how to define the url here, I think my url is not correct that why I cannot play.
My code:
self.moviePlayerController =
[[MPMoviePlayerController alloc] initWithContentURL:[[NSURL alloc] initWithString:@"http://www.dropbox.com/s/usqbtrjgcxu0ac6/pandaw.m4v"]];//http://www.youtube.com/watch?v=x3TIBhQy3XY
// NSString *videoFileName = [[NSBundle mainBundle] pathForResource:@"pandaw" ofType:@"m4v" inDirectory:nil]; // self.moviePlayerController = // [[MPMoviePlayerController alloc] initWithContentURL: [NSURL fileURLWithPath:videoFileName]];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayerDidExitFullscreen:)
name:MPMoviePlayerDidExitFullscreenNotification
object:nil];
[self.moviePlayerController prepareToPlay];
self.moviePlayerController.backgroundView.backgroundColor=[UIColor purpleColor];
[self.moviePlayerController setFullscreen:YES];
self.moviePlayerController.useApplicationAudioSession = NO;
self.moviePlayerController.movieSourceType=MPMovieSourceTypeStreaming;
[self.moviePlayerController.view setFrame:self.view.bounds];
[self.view addSubview:self.moviePlayerController.view];
if (self.moviePlayerController.isPreparedToPlay==YES) {
[self.moviePlayerController play];
}else{
NSLog(@"not yet finish in preparing");
}
Thank for your help !