MPMoviePlayerController无法播放高分辨率视频

时间:2014-08-07 13:22:37

标签: ios mpmovieplayercontroller high-resolution

在我的应用程序中,我需要使用MPMoviePlyerController播放视频。它适用于1920x1080的分辨率,但对于像3840×2160这样的高分辨率,视频无法在控制台中播放并显示_itemFailedToPlayToEnd错误。它在模拟器中运行良好,只有设备才会出现问题。我的应用程序支持7.0及更高版本。

我搜索了许多Stack Overflow答案,但没有一个能为我工作。

我无法播放的视频分辨率为:3840x2160。

这是我用来播放视频的代码

NSURL *url = [NSURL URLWithString:videoDetails.media_urlString];

self.moviePlayer = [[MPMoviePlayerController alloc]
                        initWithContentURL:url];
[[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(moviePlayBackDidFinish:)
                                                 name:MPMoviePlayerPlaybackDidFinishNotification
                                               object:self.moviePlayer];
[[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(moviePlayLoadStateChangeNotification:)
                                                 name:MPMoviePlayerLoadStateDidChangeNotification
                                               object:self.moviePlayer];
[self.moviePlayer setControlStyle:MPMovieControlStyleNone];
self.moviePlayer.view.frame = CGRectMake(self.frame.origin.x, 0, self.frame.size.width,     self.frame.size.height); //Set the size
[self.moviePlayer setFullscreen:NO];`enter code here`
[self.moviePlayer setShouldAutoplay:YES];
[self addSubview:self.moviePlayer.view];//Show the view
[self.moviePlayer play];

我测试的设备是iPad3,iPhone5s,iPhone5,iPhone4s

0 个答案:

没有答案