Once the available networking bandwidth is becoming too low to keep up proper playback, MPMoviePlayerController
will trigger the MPMoviePlayerLoadStateDidChangeNotification
and the loadState
will have MPMovieLoadStateStalled
set.
You may then mask the load-state within your notification handler and run any actions needed by your app for this state:
if ((movieController_.loadState & MPMovieLoadStateStalled) == MPMovieLoadStateStalled)
{
NSLog(@"playback stalled - make sure we don't block now!");
}
Once the player has recovered, once again the MPMoviePlayerLoadStateDidChangeNotification
is triggered and the loadState
property will have the bits for MPMovieLoadStatePlaythroughOK
set:
if ((movieController_.loadState & MPMovieLoadStatePlaythroughOK) == MPMovieLoadStatePlaythroughOK)
{
NSLog(@"playback should run uninterrupted from now on.");
}
However, I never experienced any interface slowdowns of my app caused by the MPMovieLoadStateStalled
state. I'ld say that must be your code acting weird, it is not MPMoviePlayerController
as I know it. Additionally, those notifications are always sent, I never experienced scenarios in which they were not properly triggered.
I can only recommend to recreate this issue within a minimal test-case and work your way up from that one towards your app (possibly from both sides, test-case and your app).
For simulating bandwidth breakdowns, I would recommend using Charles proxy.