CoreMedia error 12160 (CoreMediaErrorDomain) - explanation?

405 views Asked by At

I was unable to find the error explanation on web.

Somewhere in the mechanism of downloading licensed streams (HLS + FairPlay) the OS reports Error Domain=CoreMediaErrorDomain Code=-12160 "(null)" which makes downloaded movie unable to be played after download.

There must be some way to get more info about this error code. Has anyone an idea where it is defined?

1

There are 1 answers

1
Hackerman On

This happens when you use a streaming license for a AVPersistableContentKeyRequest. To convert a streaming license to a persistable license do the following:

let pckc = try keyRequest.persistableContentKey(fromKeyVendorResponse: ckcData)

Then continue to passing the response to the keyRequest as normal

let response = AVContentKeyResponse(fairPlayStreamingKeyResponseData: pckc)
keyRequest.processContentKeyResponse(keyResponse)