【问题标题】:HLS randomnly failing and going black on iOS with MPMoviePlayerHLS 在带有 MP 电影播放器​​的 iOS 上随机失败并变黑
【发布时间】:2015-10-07 16:02:40
【问题描述】:

我正在 iPad、iPhone 上播放 HLS 直播。有时,突然播放器变黑,我收到以下错误

_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)}";
    }

对不起西班牙语句子。它们的意思是Could not complete operationAn unknown error occurred

电影播放器​​在AppDelegatedidFinishLaunchingWithOptions方法中声明如下:

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

配置播放器播放如下:

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

有人知道会发生什么吗?谢谢。

【问题讨论】:

    标签: ios mpmovieplayer http-live-streaming mediaplayback


    【解决方案1】:

    我们需要更多信息,也许您的服务器在流式传输期间关闭?你用什么来提供流媒体服务? NGINX?我推荐用户PLPlayerKit播放直播

    【讨论】:

    • 嗨!对不起,来晚了。我们终于发现了这个问题,它与服务器中的播放列表缓存有关。一旦我们删除它,问题就消失了。非常感谢您的回复!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-09-17
    • 2015-12-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多