playing video iphone - mpmovieviewcontroller
I'm playing video with MPMoviePlayerViewController
. I get video url from web service. But first I select video quality with AlertView
. For example 240p 360p 480p… All video plays except 240p. MPMoviePlayerView
appears and then disappears with notification MPMovieFinishReasonPlaybackEnded
. I try to play url of 240p video in simulator, everything is perfect but in device it's not playing. I receive MPMovieFinishReasonPlaybackEnded
all the time. If I select开发者_如何转开发 360p or more, everything is good. Here is some code:
-(void) playVideoFromURL:(NSString *) url
{
NSLog(@"%@",url); //URL is valid! Browser plays it
if (!videoPlayerView) {
NSURL *fURL = [NSURL URLWithString:url];
videoPlayerView = [[MPMoviePlayerViewController alloc] initWithContentURL:fURL];
videoPlayer = videoPlayerView.moviePlayer;
[videoPlayer prepareToPlay];
}
}
It doesn't play even from the local folder. This is an iPhone app, my device is iPad 2!
精彩评论