微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决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

最好。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?