How to provide initializationData to AVContentKeySession from ResourceLoader

In my AVContentKeySession, I'm interested in providing initializationData and options: ["InitializationDataType": "sinf"] or "cenc" to my call to processContentKeyRequest.

When I call something like this:

let contentId = "data:text/plain;charset=utf-8, ... "
let initData =  "{ \"sinf\" : [\"AAAADGZyb....AAAAAAAA\"] }".data(using: String.Encoding.utf8)
       keyLoader.contentKeySession.processContentKeyRequest(withIdentifier: contentId, initializationData: initData, options: ["InitializationDataType": "sinf"])

the delegate is invoked and I receive a license response from my server.

However, I'm either confused or unaware of how one would handle specifying those parameters from the ResourceLoaderDelegate. The resource loader delegate is triggering on the EXT-X-KEY URI in my manifest. When I set the content type in the resource loader for that load request like so:

loadingRequest.contentInformationRequest?.contentType = AVStreamingKeyDeliveryContentKeyType
loadingRequest.finishLoading()
return true

It seems to call processContentKeyRequest for me (in addition to my own call). But there is no way to specify initializationData or options. However, I can see that the contentId is provided the resource loader's AVContentKeyRequest.

I know my manifest/keys/licenses "can" work as I wrote a test web page using safari EME. I am able to stream and receive valid licenses using the the mediaKey session's generateRequest where I can specify the initDataType and initData. I'm simply trying to replicate that somehow using AVContentKeySession.

I am more familiar with DASH and newer to HLS, so I'm probably confused about somthing but hoping to get pointed in the right direction here.

But I am questioning if initializationData and options for processContentKeyRequest is properly supported or not?

How to provide initializationData to AVContentKeySession from ResourceLoader
 
 
Q