iOS 6 streaming player com.apple.coremedia.networkbuffering bug

15,992

Solution 1

I was having the exact same problem...

try to do this just after you instantiate your player:

[player prepareToPlay];

It should be called automatically when you call play but apparently on iOS 6 something goes wrong if you don't call it explicitly.

In my case it solved the problem.

Solution 2

What you are observing is not a crash but an exception. You most likely have an exception breakpoint enabled and that leads you to the assumption that the app crashes.

That exception actually is properly handled (cought) by the SDK and does not cause an app crash.

Please note that this is only happening on the simulator, not on the device.

The issue is closely related to this issue what-does-this-gdb-output-mean. The difference is that you won't get those error messages anymore but the exception's still are thrown (but also cought).

Solution 3

i have verified using xcode 4.5+SDK6.0 versus xcode 4.4.1+SDK5.1 combinations that there is an issue with ios 6 version of the MPMoviePlayerController. i have only worked with iPads though.

here are my observations:- - i have never seen the video play on ios 6.0 with my code that uses MPMoviePlayerController. - with xcode 4.4.1 and SDK 5.1, i have seen the code work on ios versions 5.1, 5.0 and 4.3. - with xcode 4.5 and SDK 6.0, the player always fails in the simulator, but most installations on ios 5.1 device work. i kept reinstalling the app on ios 5.1 device and trying out the player. it only failed once.

here are my observations when the player failed: - some times when the player failed, i saw the logs that you mentioned above. other times, i didnt even see the logs. - i put a breakpoint in the function that got the MPMoviePlayerPlaybackDidFinishNotification notification. then i looked for the errorLog in the player and there was none. i looked for MPMoviePlayerPlaybackDidFinishReasonUserInfoKey and it was 0 (MPMovieFinishReasonPlaybackEnded). so MPMoviePlayerController had no clue anything had gone wrong!

conclusion: ios6 and/or SDK 6 have got a bug.

Solution 4

NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"sample" ofType:@"mp4"]];
MPMoviePlayerViewController  *moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:url];



moviePlayer.view.frame = self.view.frame;
moviePlayer.moviePlayer.shouldAutoplay=YES;
moviePlayer.moviePlayer.controlStyle = MPMovieControlStyleNone;
[moviePlayer.moviePlayer setFullscreen:YES animated:YES];
[self.view addSubview:moviePlayer.view];
[moviePlayer.moviePlayer play];

Note : Before iOS 6, no need to call [moviePlayer.moviePlayer play]; once you add player view to a view it will start to play but in iOS 6, you need to call play function explicitly

Solution 5

i am having the same issue with MPMoviePlayerController for ios6. So i changed my code to fllowing and now it is working fine..

NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"sample" ofType:@"mp4"]];
MPMoviePlayerViewController  *moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:url];



moviePlayer.view.frame = self.view.frame;
moviePlayer.moviePlayer.shouldAutoplay=YES;
moviePlayer.moviePlayer.controlStyle = MPMovieControlStyleNone;
[moviePlayer.moviePlayer setFullscreen:YES animated:YES];
[self.view addSubview:moviePlayer.view];
[moviePlayer.moviePlayer play];
Share:
15,992

Related videos on Youtube

jMelnik
Author by

jMelnik

Mobile Developer (iOS and Android)

Updated on June 04, 2022

Comments

  • jMelnik
    jMelnik almost 2 years

    I'm having trouble on make my app(music and video stream player) running on iOS 6 simulator.

    When I start a music ou video it crashes showing an error on this thread: com.apple.coremedia.networkbuffering

    and this on log info:

    2012-09-13 17:45:09.260 app[32563:c07] [MPAVController] Autoplay: Disabling autoplay for pause
    2012-09-13 17:45:09.260 app[32563:c07] [MPAVController] Autoplay: Disabling autoplay
    2012-09-13 17:45:09.305 app[32563:c07] [MPAVController] Autoplay: Enabling autoplay
    2012-09-13 17:45:09.307 app[32563:c07] handlePlaybackNowPlayingNotification
    2012-09-13 17:45:09.308 app[32563:c07] [MPAVController] Autoplay: Likely to keep up or full buffer: 0
    2012-09-13 17:45:09.308 app[32563:c07] [MPAVController] Autoplay: Skipping autoplay, not enough buffered to keep up.
    2012-09-13 17:45:09.318 app[32563:c07] [MPAVController] Autoplay: Enabling autoplay
    2012-09-13 17:45:09.320 app[32563:c07] [MPCloudAssetDownloadController] Prioritization requested for media item ID: 0
    

    I'm using MPMoviePlayerController with http based stream, and it works fine on iOS 4 or iOS 5

    Any ideas on how to fix it?

    • Steve Moser
      Steve Moser over 11 years
      Just a note. I get the same problem in the simulator but it works fine on the device.
  • eli
    eli over 11 years
    Solved the problem for me as well. Beforehand I wasn't getting the moviePlayerLoadStateChanged notifications, now I am.
  • jMelnik
    jMelnik over 11 years
    Yep, that seems to solve the problem, I added that line and until now no more errors like tha. Thank you
  • WendiKidd
    WendiKidd over 11 years
    I added this line but am still getting errors similar to the ones in the OP's question. Any ideas?
  • Valerio Santinelli
    Valerio Santinelli over 11 years
    0 equals to MPMovieFinishReasonPlaybackEnded. You probably do not want to start the movie again once it's reached its end.
  • M Penades
    M Penades over 11 years
    In my case it was enough removing the: moviePlayer.view.frame = self.view.frame;