There are two changes needed:
First, in fps_safari_support.js, change "streaming-keys" to "create-ckc" in both the JSON request and response. This file is outdated and we will correct it in a future version of the SDK. It should look like this:
...
"fairplay-streaming-request" : {
"version" : 1,
"create-ckc" : [{
...
let keyResponse = responseObject["fairplay-streaming-response"]["create-ckc"][0];
...
Second, you will have to translate the keyURI value to asset information (content key, iv, content type, hdcp requirement, etc). The way to do this depends on how you implement your server, which could be done by either of the following options:
A) Implement queryDatabaseCustom in the SDK. It gives you the assetID (aka keyURI) extracted from the SPC. Then you lookup the corresponding asset information in your database, and fill in the asset information structure in code.
B) Implement server-side logic in front of the FairPlay key server module to read the "uri" value, look up the corresponding asset information in your database, replace the "uri": keyURI, field with something like below, and send to the FairPlay key server module:
"asset-info": [
{
"content-key": "0102030405060708090A0B0C0D0E0F10",
"content-iv": "F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF",
"content-type": "hd",
"encryption-scheme": "cbcs",
"hdcp-type": 0,
"lease-duration": 1200
}
],
you can find more examples inputs in the Test_Inputs folder.