现象:ios14.6以后不能生成新的spc data,之前可以,
生成spc使用的api是:
- (void)makeStreamingContentKeyRequestDataForApp:(NSData *)appIdentifier
contentIdentifier:(nullable NSData *)contentIdentifier
options:(nullable NSDictionary<NSString *, id> *)options
completionHandler:(void (^)(NSData * _Nullable contentKeyRequestData, NSError * _Nullable error))handler;
ios14.6后,返回错误代码:{Error Domain=AVFoundationErrorDomain Code=-11879 "(null)"}}
苹果Apple官方解释:-11879 is AVErrorContentKeyRequestCancelled.
直接上解决方法:
创建session时候出了问题:
有两种解决方法:下面的2或3;
不设置路径;
1、AVContentKeySession *session = [AVContentKeySession contentKeySessionWithKeySystem:AVContentKeySystemFairPlayStreaming];
不生成文件,不需要设置路径参数 ios11以