[AVAssetResourceLoadingRequest streamingContentKeyRequestDataForApp:contentIdentifier:options:error:]; を使用しようとしています。メソッドを使用して SPC キーを取得しましたが、意図した SPC 値ではなく nil が返されました。主に、提供されている Fairplay アプリケーションの例を参照しています。エンコードされたリクエスト URL ホスト文字列をコンテンツ識別子として使用し、SPC サーバーから取得した .DER 証明書をアプリ データとして使用しています。他の誰かがこの問題を経験しましたか?
NSString *hostString = [URL host];
NSData *assetId = [NSData dataWithBytes:[hostString cStringUsingEncoding:NSUTF8StringEncoding] length:[hostString lengthOfBytesUsingEncoding:NSUTF8StringEncoding]];
NSData *certificate = (obtained via Key Server).
NSError *error;
NSData *SPC = [loadingRequest streamingContentKeyRequestDataForApp:certificate contentIdentifier:assetId options:nil error:&error]
ここでの SPC の出力は nil です。完全なエラーの説明は次のとおりです。
Error Domain=AVFoundationErrorDomain
Code=-11800 "The operation could not be completed"
UserInfo=0x170461980
{NSUnderlyingError=0x1740548e0 "The operation couldn’t be completed. (OSStatus error -12640.)",
NSLocalizedFailureReason=An unknown error occurred (-12640),
NSLocalizedDescription=The operation could not be completed}