问题描述
五年来,我们一直在使用相同的AVAsset加载器方法。最近,随着iOS 14.2的发布,加载程序方法现在失败。具体来说,当尝试读取h.264编码的mp4中的元数据时,它始终返回“此媒体可能已损坏”。只有使用https远程加载的mp4才会发生这种情况。
这是一个使用resourceLoader类来辅助远程URL的示例。
AVURLAsset *mAsset = [AVURLAsset URLAssetWithURL:URL options:nil];
[mAsset.resourceLoader setDelegate:self->mAssetResourceLoader queue:dispatch_get_main_queue()];
[mAsset loadValuesAsynchronouslyForKeys:@[@"availableMetadataFormats"] completionHandler:^{
// Setup
NSError *error = nil;
RLScene *scene = nil;
AVkeyvalueStatus status = [mAsset statusOfValueForKey:@"availableMetadataFormats" error:&error];
switch (status) {
case AVkeyvalueStatusLoaded:
NSLog(@"Sucessfully loaded,continue processing");
break;
case AVkeyvalueStatusFailed:
NSLog(@"examine NSError pointer to determine failure");
break;
case AVkeyvalueStatusCancelled:
NSLog(@"Loading cancelled");
break;
default:
NSLog(@"Handle all other cases");
break;
}
NSLog(@" %@",error.localizedFailureReason);
以上内容不会返回可读状态。该错误将始终仅在14.2中返回“此媒体可能已损坏”。否则可以成功返回iOS 10
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)