Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
253 views
in Technique[技术] by (71.8m points)

iphone - MPMoviePlayerViewController Generating lots of errors

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];
}

The error messages

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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

or errors.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...