0

我们正在使用 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 上不起作用。有人可以帮忙吗?

4

1 回答 1

1

在 EZDRM 的iOS 离线示例中,他们使用iOS11作为基础版本。这不是巧合,它只支持iOS11及以上

持久内容密钥是在 iOS 10 中引入的,所以它应该可以工作

这不仅仅是关于持久内容密钥的全部内容,他们在那之后添加了更多内容,例如,他们在 iOS 10.3 版中添加了 AVContentKeySession 等。我不确定 EZDRM 是否支持,但这是 SDK 中的重要进展。

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

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

最好的。

于 2020-08-20T07:39:19.907 回答