在资产加载期间发生错误时,我必须处理HTTP状态:
[asset loadValuesAsynchronouslyForKeys:requestedKeys completionHandler: ^{
dispatch_async( dispatch_get_main_queue(), ^{
for (NSString *thisKey in requestedKeys) {
NSError *error = nil;
AVKeyValueStatus keyStatus = [asset statusOfValueForKey:thisKey error:&error];
if (keyStatus == AVKeyValueStatusFailed) {
[self playbackFailedWithError:error];
return;
}
}
});
}];
视频文件网址 410 Gone HTTP状态。在这种情况下,需要从API重试文件,但错误返回:
Error Domain=AVFoundationErrorDomain Code=AVErrorUnknown
如何检索响应的HTTP代码或有关错误的更多详细信息?