开发者

playing video iphone - mpmovieviewcontroller

开发者 https://www.devze.com 2023-04-10 00:22 出处:网络
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. MPMovi

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!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号