问题描述
我遇到了让MPMoviePlayerViewController工作的问题。我有一个新项目,在viewDidLoad之后我尝试在moviePlayerViewController中播放电影,如下所示。我得到了电影,我收到了很多错误信息,如下所示。有人可以解释我做错了什么来获取这些错误
I am having issues to get MPMoviePlayerViewController to work. I have a new project that after viewDidLoad I try to play the movie in a moviePlayerViewController as below. I get the movie to play put I get lots and lots of error messages as below. Can someone explain what I am doing wrong to get these errors
- (void)viewDidLoad
{
[super viewDidLoad];
[ self play ];
}
- (void) play {
NSURL *filmURL = [ NSURL URLWithString:@"http://www.ud-ltd.com/ipmt/Film16.mp4" ];
self.mvc = [[MPMoviePlayerViewController alloc] initWithContentURL:filmURL ];
[ self presentMoviePlayerViewControllerAnimated:self.mvc ];
[ self.view addSubview:self.mvc.view ];
[ self.mvc.moviePlayer play];
}
错误消息
Jan 8 21:19:28 rezas-macbook.home MoviePlayer[30320] <Error>: CGContextSaveGState: invalid context 0x0
Jan 8 21:19:28 rezas-macbook.home MoviePlayer[30320] <Error>: CGContextClipToRect: invalid context 0x0
Jan 8 21:19:28 rezas-macbook.home MoviePlayer[30320] <Error>: CGContextTranslateCTM: invalid context 0x0
Jan 8 21:19:28 rezas-macbook.home MoviePlayer[30320] <Error>: CGContextDrawShading: invalid context 0x0
Jan 8 21:19:28 rezas-macbook.home MoviePlayer[30320] <Error>: CGContextRestoreGState: invalid context 0x0
2013-01-08 21:19:28.526 MoviePlayer[30320:c07] [MPAVController] Autoplay: Disabling autoplay for pause
2013-01-08 21:19:28.527 MoviePlayer[30320:c07] [MPAVController] Autoplay: Disabling autoplay
2013-01-08 21:19:28.528 MoviePlayer[30320:c07] Warning: Attempt to present <MPMoviePlayerViewController: 0x916ec10> on <ViewController: 0x916c9c0> whose view is not in the window hierarchy!
2013-01-08 21:19:28.536 MoviePlayer[30320:c07] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 1, on player: 0)
2013-01-08 21:19:29.864 MoviePlayer[30320:c07] [MPAVController] Autoplay: Enabling autoplay
2013-01-08 21:19:29.868 MoviePlayer[30320:c07] [MPAVController] Autoplay: Likely to keep up or full buffer: 0
2013-01-08 21:19:29.868 MoviePlayer[30320:c07] [MPAVController] Autoplay: Skipping autoplay, not enough buffered to keep up.
2013-01-08 21:19:29.870 MoviePlayer[30320:c07] [MPAVController] Autoplay: Enabling autoplay
2013-01-08 21:19:29.871 MoviePlayer[30320:c07] [MPCloudAssetDownloadController] Prioritization requested for media item ID: 0
2013-01-08 21:19:30.964 MoviePlayer[30320:c07] [MPAVController] Autoplay: Likely to keep up or full buffer: 0
2013-01-08 21:19:30.964 MoviePlayer[30320:c07] [MPAVController] Autoplay: Skipping autoplay, not enough buffered to keep up.
2013-01-08 21:19:31.494 MoviePlayer[30320:c07] [MPAVController] Autoplay: _streamLikelyToKeepUp: 0 -> 1
2013-01-08 21:19:31.495 MoviePlayer[30320:c07] [MPAVController] Autoplay: Likely to keep up or full buffer: 1
2013-01-08 21:19:31.495 MoviePlayer[30320:c07] [MPAVController] Autoplay: Enabling autoplay
推荐答案
我也在使用MPMoviePlayerViewController在我的App& amp;我也
I am also using MPMoviePlayerViewController to play live video in one of my App & I also
得到这些错误但除了这些错误之外我的视频在这个播放器上播放得很好。
getting these errors but besides these errors my video is playing fine with this player.
我认为它没有解决方案。如果您的视频工作正常,请忽略这些警告
I think there is no solution for it. If your video is working fine then ignore these warnings
或错误。
这篇关于MPMoviePlayerViewController生成大量错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!