AVContentSessionKey를 사용하는 FairPlay Streaming Server SDK v4.0.1에서 데모를 따라 HLS Fairplay로 오프라인 재생을 구현하고 있습니다. 이 코드를 사용하여 Im을 재생하기 전에 WIFI를 다운로드 할 때 세 가지 컨텐츠를 다운로드하고 올바르게 보관합니다. .movpkg와 해당 컨텐츠 키가 모두 document 디렉토리에 있습니다.앱을 닫을 때 오프라인 HLS Fairplay 재생 오류 코드 16227
let urlAsset = element.urlAsset!
ContentKeyManager.shared.contentKeySession.addContentKeyRecipient(urlAsset)
if !urlAsset.resourceLoader.preloadsEligibleContentKeys {
urlAsset.resourceLoader.preloadsEligibleContentKeys = true
}
self.present(playerViewController, animated: true, completion: {
AssetPlaybackManager.sharedManager.setAssetForPlayback(urlAsset)
})
지금까지 그렇게 좋았습니다. 그러나 문제는 응용 프로그램을 닫고 응용 프로그램을 닫고 다운로드 한 내용을 재생하면 마지막으로 다운로드 한 내용 만 올바르게 재생되고 나머지 내용은 첫 번째 및 두 번째 콘솔에서 이러한 오류를 보내는 것입니다.
Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed"
UserInfo={NSUnderlyingError=0x1c065d760 {Error Domain=NSOSStatusErrorDomain Code=-16227 "(null)"},
NSLocalizedFailureReason=An unknown error occurred (-16227),
NSURL=file:///private/var/mobile/Containers/Data/Application/A950D8DB-B711-47E3-AAF5-C95CC9682430/Library/com.apple.UserManagedAssets.kkG8Ih/644986_7798B8476A473F68.movpkg/, NSLocalizedDescription=The operation could not be completed}
나는 문서 디렉토리에있는 키를 사용하여 .movpkg을 다시 확인하고 오류가 ContentKeyDelegate가 호출 발생하고 키가로드 올바르게 요청에 전달하기 전에 올바르게
/Documents/.keys/one-key
/Documents/.keys/two-key
/Documents/.keys/three-key
나타납니다.
persistableContentKeyExistsOnDisk (withContentKeyIdentifier : assetIDString)가 있다면이 contentKeyRecipients를 인쇄 할 경우 {
let urlToPersistableKey = urlForPersistableContentKey(withContentKeyIdentifier: assetIDString)
guard let contentKey = FileManager.default.contents(atPath: urlToPersistableKey.path) else {
/
pendingPersistableContentKeyIdentifiers.remove(assetIDString)
return
}
/
Create an AVContentKeyResponse from the persistent key data to use for requesting a key for
decrypting content.
*/
let keyResponse = AVContentKeyResponse(fairPlayStreamingKeyResponseData: contentKey)
/
keyRequest.processContentKeyResponse(keyResponse)
return
}
이 세 가지 내용이
- (lldb) po
ContentKeyManager.shared.contentKeySession.contentKeyRecipients ▿ 3
elements
- 0 : AVURLAsset: 0x1c0234d40, URL = file:///private/var/mobile/Containers/Data/Application/E791A4DE-4261-46B7-A84D-D10B27035FAE/Library/com.apple.UserManagedAssets.kkG8Ih/539628_20469336224AA388.movpkg
- 1 : AVURLAsset: 0x1c0234fa0, URL = file:///private/var/mobile/Containers/Data/Application/E791A4DE-4261-46B7-A84D-D10B27035FAE/Library/com.apple.UserManagedAssets.kkG8Ih/644986_7798B8476A473F68.movpkg
- 2 : AVURLAsset: 0x1c42391c0, URL = file:///private/var/mobile/Containers/Data/Application/E791A4DE-4261-46B7-A84D-D10B27035FAE/Library/com.apple.UserManagedAssets.kkG8Ih/573744_62377F9549C45B93.movpkg
내 시험은 11.2 베타 2
아이폰 OS 11.1.2 및 iOS에 제대로 표시나는 무슨 일이 일어나고 있는지 모르겠지만 지속 된 키에 문제가있는 것처럼 보입니다. 각 콘텐츠가 b면 어떻게 될지 모르겠습니다. e는 한 번에 하나의 AVContentKeySession과 연관됩니다.
누군가 비슷한 문제에 직면하면 도움을받을 수 있습니다.
미리 감사드립니다.