我正在使用AVAssetResourceLoaderDelegate加载字幕和其他音频曲目(m2u8播放列表)。我使用AVContentKeySession和AVContentKeySessionDelegate来解密内容(DRM)。另外,它们都工作得很好:字幕被加载和显示,AVPlayer要求密钥,它被成功地服务。但是,当我将它们一起使用时,AVPlayer从不通过AVContentKeySessionDelegate请求它的密钥。
当我在resourceLoader内部时,我曾尝试通过processContentKeyRequest手动请求密钥。即使我得到了内容密钥,看起来AVPlayer也从未收到过。
我不能在AVAssetResourceLoaderDelegate中处理密钥,因为我需要解决双重过期问题,所以我需要使用AVContentKeySessionDelegate来接收didUpdatePersistableContentKey。
发布于 2020-05-27 01:51:18
显然,AVAssetResourceLoaderDelegate的shouldWaitForLoadingOfRequestedResource必须返回false才能启动密钥会话加载。
https://stackoverflow.com/questions/62026929
复制相似问题