我想以编程方式调用
func resourceLoader(_ resourceLoader: AVAssetResourceLoader, shouldWaitForLoadingOfRequestedResource loadingRequest: AVAssetResourceLoadingRequest) -> Bool
来自AVURLAsset
, 的代表AVPlayer
,AVAssetResourceLoaderDelegate
这样我就可以兑现 ckc 数据,以便我可以离线播放解密的内容。
我按照https://developer.apple.com/videos/play/wwdc2016/504/的步骤
如果我播放AVURLAsset
现金 ckc 密钥数据然后关闭互联网并AVURLAsset
再次播放它可以正常工作,我可以离线观看视频。
但我需要调用该resourseLoader
函数而不播放视频。
我无法执行这些步骤的原因是因为要获取 ckc 数据,我需要loadingRequest
来自委托函数的对象resourceLoader
。
有没有办法在我存储密钥时不调用 play 方法并丢弃播放器来实现这一点?