简体   繁体   English

错误域 = AVFoundationErrorDomain 代码 = -11800 “操作无法完成。错误域 = NSOSStatusErrorDomain 代码 = -16170 “(空)”

[英]Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed. Error Domain=NSOSStatusErrorDomain Code=-16170 "(null)"

I am using AVPlayer in my chat application but i am getting the fallowing error in selected audio files but the audio files correctly play in browser.我在我的聊天应用程序中使用 AVPlayer,但在选定的音频文件中出现了错误,但音频文件在浏览器中正确播放。

Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSUnderlyingError=0x60800024fde0 {Error Domain=NSOSStatusErrorDomain Code=-16170 "(null)"}, NSLocalizedFailureReason=An unknown error occurred (-16170), NSLocalizedDescription=The operation could not be completed}错误域=AVFoundationErrorDomain 代码=-11800“操作无法完成” UserInfo={NSUnderlyingError=0x60800024fde0 {错误域=NSOSStatusErrorDomain 代码=-16170“(null)”},NSLocalizedFailureReason=发生未知错误(-16170),NSLocalizedDescription =操作无法完成}

I am implementing the following methods.我正在实施以下方法。

-(void)setupAVPlayerForURL:(NSURL*)url
 {
    AVAsset *asset = [AVURLAsset URLAssetWithURL:url options:nil];
    AVPlayerItem *anItem = [AVPlayerItem playerItemWithAsset:asset];
    playerAud = nil;
    playerAud = [AVPlayer playerWithPlayerItem:anItem];
    [self startTimer];
    [playerAud play];
    [anItem addObserver:self forKeyPath:@"status" options:NSKeyValueObservingOptionNew context:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(stopAudioPlay) name:AVPlayerItemDidPlayToEndTimeNotification object:nil];
}

And also implement the fallowing observer.

- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
    //// playerAud is instance of AVPlayer 
    if (object == playerAud.currentItem && [keyPath isEqualToString:@"status"]) {
        if (playerAud.currentItem.status == AVPlayerItemStatusFailed) {
            NSLog(@"------player item failed:%@",playerAud.currentItem.error);
        }
    }
}

It prints the above error.

就我而言,我使用 http url.Set NSAllowsArbitraryLoads to YES修复错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AVAssetExportSession AVFoundationErrorDomain代码-11800无法完成操作,NSOSStatusErrorDomain代码= -12780“(空)在Swift iOS中 - AVAssetExportSession AVFoundationErrorDomain Code -11800 The operation could not be completed, NSOSStatusErrorDomain Code=-12780 "(null) in Swift iOS 错误域=NSOSStatusErrorDomain 代码=1954115647 “(空)” - Error Domain=NSOSStatusErrorDomain Code=1954115647 “(null)” 无法确定当前的国家/地区代码:Error Domain = GEOErrorDomain Code = -2“操作无法完成。 (GEOErrorDomain错误-2。)” - Could not determine current country code: Error Domain=GEOErrorDomain Code=-2 “The operation couldn’t be completed. (GEOErrorDomain error -2.)” Error Domain = NSCocoaErrorDomain代码= 512“该操作无法完成。该操作无法完成。是一个目录 - Error Domain=NSCocoaErrorDomain Code=512 "The operation couldn’t be completed.The operation couldn’t be completed. Is a directory 缩略图的生成失败,错误为AVFoundationErrorDomain Code = -11800 - Generation of thumbnail fails with error AVFoundationErrorDomain Code=-11800 错误:错误域= NSCocoaErrorDomain代码= 3840“该操作无法完成。 - Error:Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. didFailWithError:错误域= kCLErrorDomain代码= 0“无法完成操作。 (kCLErrorDomain错误0。)“ - didFailWithError: Error Domain=kCLErrorDomain Code=0 “The operation couldn’t be completed. (kCLErrorDomain error 0.)” 错误域= NSCocoaErrorDomain代码= 3840“操作无法完成。(可可错误3840.) - Error Domain = NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.) Error Domain = NSURLErrorDomain代码= 403“操作无法完成。 (NSURLErrorDomain错误403。)” - Error Domain=NSURLErrorDomain Code=403 “The operation couldn’t be completed. (NSURLErrorDomain error 403.)” 错误域=kCLErrorDomain 代码=2“操作无法完成。(kCLErrorDomain 错误 2。)” - Error Domain=kCLErrorDomain Code=2 "The operation couldn’t be completed. (kCLErrorDomain error 2.)"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM