I'm trying to display a video using MPMoviePlayerController, but I can't manage to make it works. My video is on my server. So I'm trying to display it this way :
-(void) playMovieAtURL: (NSURL*) theURL {
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:theURL];
moviePlayer.view.frame = self.view.bounds;
moviePlayer.controlStyle = MPMovieControlModeDefault;
moviePlayer.movieSourceType = MPMovieSourceTypeFile;
moviePlayer.fullscreen = YES;
[self.view addSubview:moviePlayer.view];
[moviePlayer prepareToPlay];
[moviePlayer play];
}
moviePlayer is a property of my viewController. The URL given is correct (tested in safari). My video is a .mov video.
When my function is called, I'm just having a black screen. Controls don't appear, and I think that the video doesn't load because in the status bar of the app, the network activity indicator is not displayed.
Any help is welcome.
EDIT
I've just noticed that trying to reach the video from the device's safari app result this :
EDIT 2
My video is 480 × 850, and MPMoviePlayerController only support video up to 640 x 480. So it can't be played with this framework. Do I have to resize my video, or is there another frameworks that I can use to displayed it? I just need a very simple player...