gpt4 book ai didi

ios - 获取关键请求数据时出错: AVFoundationErrorDomain reason: Optional ("An unknown error occurred (-42650)")

转载 作者:行者123 更新时间:2023-12-03 20:03:52 25 4
gpt4 key购买 nike

我正在实现 Apple Fireplay DRM 以向设备传送加密内容。我能够成功加载证书,但是当我尝试从 AVAssetResourceLoadingRequest 获取 SPC 数据时,出现此错误。

Error obtaining key request data: AVFoundationErrorDomain reason: Optional("An unknown error occurred (-42650)")

以下是检索 SPC 内容的代码

let spcData: Data!

do {
/*
To obtain the Server Playback Context (SPC), we call
AVAssetResourceLoadingRequest.streamingContentKeyRequestData(forApp:contentIdentifier:options:)
using the information we obtained earlier.
*/
spcData = try resourceLoadingRequest.streamingContentKeyRequestData(forApp: applicationCertificate, contentIdentifier: assetIDData, options: resourceLoadingRequestOptions)
} catch let error as NSError {
print("Error obtaining key request data: \(error.domain) reason: \(error.localizedFailureReason)")
resourceLoadingRequest.finishLoading(with: error)
return
}

我已经在苹果开发者论坛上搜索了错误代码:42650,但没有成功!

最佳答案

我也遇到这个错误了。就我而言,我使用错误的数据格式(resourceLoadingRequest.streamingContentKeyRequestData(forApp:contentIdentifier:options:) 函数中的 appIdentifier 参数)生成 applicationCertificate 提供给我的证书是 base64 编码的。所以我需要用 Data(base64Encoded: yourCertificateString) 创建数据.

关于ios - 获取关键请求数据时出错: AVFoundationErrorDomain reason: Optional ("An unknown error occurred (-42650)"),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45415644/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com