尝试使用AVPlayer播放媒体时iOS上的NSError错误代码-11819

时间:2013-03-26 18:13:32

标签: ios avplayer

尝试使用AVPlayer播放媒体网址时,我收到错误代码为-11819的AVPlayerStatusFailed。请指教。

- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change: (NSDictionary *)change context:(void *)context
{
  if (context == &AVPlayerItemStatusContext) {
    AVPlayerItem *playerItem = (AVPlayerItem *)object;
    NSInteger status = [playerItem status];
    switch (status) {
        case AVPlayerStatusFailed:
        {
            NSError *error = [playerItem error];
            NSLog(@"%s %d\n", __FUNCTION__, [error code]);
            .....
        }
  ....

}

1 个答案:

答案 0 :(得分:0)

我在AVError.h中发现AVFoundation错误代码-11819对应于AVErrorMediaServicesWereReset(“因为媒体服务不可用而无法完成操作”)。