FairPlay离线播放在iOS 10上不起作用

问题描述

我们正在使用EZDRM进行DRM保护。

在线播放在iOS 10-13上运行良好,而离线播放在iOS 11-13上运行,但在iOS 10上不行;持久性内容密钥是iOS 10中引入的,因此它应该可以工作。

我已经使用EZDRM的示例项目进行了测试,该项目使用了AVAssetResourceLoaderDelegate。下载视频和内容密钥后,当我们尝试播放下载的视频时,发生以下错误。

Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSUnderlyingError=0x17005d1c0 {Error Domain=NSOSStatusErrorDomain Code=-42651 "(null)"},NSLocalizedFailureReason=An unknown error occurred (-42651),NSLocalizedDescription=The operation could not be completed}
Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSUnderlyingError=0x17005be40 {Error Domain=NSOSStatusErrorDomain Code=-12882 "(null)"},NSLocalizedFailureReason=An unknown error occurred (-12882),NSLocalizedDescription=The operation could not be completed}

记录加载请求对象(从iOS 10开始):

<AVAssetResourceLoadingRequest: 0x174201f10,URL request = <NSMutableURLRequest: 0x1702009a0> { URL: skd://fps.ezdrm.com/;xxxxxx },request ID = 2,content information request = <AVAssetResourceLoadingContentInformationRequest: 0x174202060,content type = "(null)",content length = 0,byte range access supported = NO,disk caching permitted = NO,renewal date = (null)>,data request = <AVAssetResourceLoadingDataRequest: 0x174201de0,requested offset = 0,requested length = 9223372036854775807,requests all data to end of resource = YES,current offset = 0>>

我发现:

  • disk caching permitted = NO在iOS 10上
  • disk caching permitted = YES在iOS 11-13上

不确定是不是失败原因,也不知道哪个部分控制此属性的值。

我还使用了Apple的HLSCatalogWithFPS进行测试,该测试使用了AVContentKeySession。最初,其部署目标是iOS 11.3,我做了一些修改,使其也可以在iOS 10.3上运行,例如:

  • keyRequest.respondByRequestingPersistableContentKeyRequestAndReturnError()-> keyRequest.respondByRequestingPersistableContentKeyRequest()
  • AVAggregateAssetDownloadTask-> AVAssetDownloadTask

但是,在调用respondByRequestingPersistableContentKeyRequest()之后,并未调用contentKeySession:didProvidePersistableContentKeyRequest:,而是调用了contentKeySession:didProvideContentKeyRequest:,并在此处创建了无限循环。

根据文档https://developer.apple.com/documentation/avfoundation/avcontentkeyrequest/2799207-respondbyrequestingpersistableco

如果您的委托不响应contentKeySession:didProvidePersistableContentKeyRequest :,则返回NSInternalInconsistencyException。

因此,我试图注释掉该委托方法,但一点也不例外。如果它运行在iOS 11上,则会出现异常。

似乎整个FairPlay离线播放功能都无法在iOS 10上运行。任何人都可以帮忙吗?

解决方法

在EZDRM的 iOS离线版Example 中,他们使用 iOS11 作为基本版本。这不是巧合,它仅支持 iOS11及更高版本

iOS 10中引入了持久内容密钥,因此它应该可以工作

这与持久性内容密钥无关,他们在此之后添加了更多内容,例如,他们在iOS 10.3版中添加了AVContentKeySession,等等。我不确定EZDRM是否支持它,但这在SDK中很重要。 / p>

公司只能支持稳定版本。我不确定他们的具体原因,但我可以理解。我从未使用过EZDRM的SDK。

另外,请检查文档:https://www.ezdrm.com/Documentation/EZDRM_Testing_Playback_v2.pdf

最好。

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...