2017-07-31 3 views
3

暗号化されたコンテンツをデバイスに配信するためにApple Fireplay DRMを実装しています。 証明書を正常に読み込めましたが、AVAssetResourceLoadingRequestからSPCデータを取得しようとすると、このエラーが発生します。キーリクエストデータの取得中にエラーが発生しました:AVFoundationErrorDomain理由:オプション(「不明なエラーが発生しました(-42650)」)

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 
    } 

を取得するためのコードである私はすでに、エラーコードで検索しない:Appleデベロッパフォーラムに42650が、ない幸運!

+0

複数の端末で試しましたか? – aergistal

答えて

1

このエラーもあります。私のケースでは、間違ったデータフォーマット(resourceLoadingRequest.streamingContentKeyRequestData(forApp:contentIdentifier:options:)のappIdentifierパラメータ)を使用してapplicationCertificateを生成していました。私に与えられた証明書はbase64でエンコードされていました。だから私はData(base64Encoded: yourCertificateString)でデータを作成する必要があります。

関連する問題