1

I am playing an HLS live streaming in iPad, iPhone. Sometimes, suddenly the player goes black and I get the following error

_itemFailedToPlayToEnd: {
        AVPlayerItemFailedToPlayToEndTimeErrorKey = "Error Domain=AVFoundationErrorDomain Code=-11800 \"No se ha podido completar la operaci\U00f3n\" UserInfo=0x15a50740 {NSLocalizedDescription=No se ha podido completar la operaci\U00f3n, NSUnderlyingError=0x1467e9e0 \"The operation couldn\U2019t be completed. (OSStatus error -12312.)\", NSLocalizedFailureReason=Se ha producido un error desconocido (-12312)}";
    }

Sorry for the Spanish sentences. They mean Could not complete operation and An unknown error occurred.

Movie player is declared in the AppDelegate didFinishLaunchingWithOptions method as follows:

self.videoplayer = [[MPMoviePlayerController alloc] init];
self.videoplayer.movieSourceType = MPMovieSourceTypeStreaming;

Configuring the player to play is done as follows:

-(void) configureAndPlayPlayer:(NSURL *)contentURL
{
AppDelegate * app = (AppDelegate *)[UIApplication sharedApplication].delegate;
[app.videoplayer.view removeFromSuperview];

[self.view addSubview:app.videoplayer.view];
[self videoPlayerFrame];
[app.videoplayer stop];
app.videoplayer.contentURL = contentURL;

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
    app.videoplayer.view.center = self.view.center;
    [self videoPlayerFrame];
    CGRect frame = app.videoplayer.view.frame;
    frame.origin.y = 0;
    frame.origin.x = 0;
    app.videoplayer.view.frame = frame;
}
[app.videoplayer setScalingMode:MPMovieScalingModeAspectFit];
[app.videoplayer play];

app.eventPlaying = self.eventPlaying;
app.catchupPlaying = (self.isCatchup) ? YES : NO;
}

Does anybody know what could be happening? Thank you.

DᴀʀᴛʜVᴀᴅᴇʀ
  • 7,681
  • 17
  • 73
  • 127
YU No
  • 69
  • 1
  • 7

1 Answers1

1

we need some more information, maybe your server is shutting down during streaming? what are you using to serve streaming? NGINX? i recommend user PLPlayerKit to play live streaming

alfreedom
  • 447
  • 5
  • 15
  • Hi! Sorry for being late. We finally detected the problem, it had to do with playlist caching in the servers. Once we removed it, the problem was gone. Thank you very much for your reply! – YU No Oct 15 '15 at 09:08