Product
Player
Question
Hello folks,
Is there a sample of how to configure the player to work with Axinom’s license server for FairPlay? I saw couple of examples of the Bitmovin doc site (Streaming DRM protected content with Bitmovin Player Web SDK ) , but nothing specific to Axinom.
Cheers,
Łukasz
Hi @Lukasz.Bajorski !
Which Player SDK are you using, iOS/tvOS or Web SDK?
@Lukasz.Bajorski For iOS here is an example:
let sourceConfig = SourceConfig(url: URL(string: "MANIFEST URL HERE...")!)!
// replace with your license URL
let licenseURL = URL(string: "https://drm-fairplay-licensing.axtest.net/AcquireLicense")!
let certificateURL = URL(string: "https://vtb.axinom.com/FPScert/fairplay.cer")!
let fpsConfig = FairplayConfig(license: licenseURL, certificateURL: certificateURL)
let token = "YOUR TOKEN HERE..."
fpsConfig.licenseRequestHeaders = [
"content-type": "application/octet-stream",
"X-AxDRM-Message": token
]
fpsConfig.prepareMessage = { spcData, _ in spcData }
fpsConfig.prepareContentId = { contentId in
contentId.components(separatedBy: "/").last ?? contentId
}
fpsConfig.prepareSyncMessage = { spcData, _ in spcData }
sourceConfig.drmConfig = fpsConfig
Hi Ronald,
I made Web work with the much appreciated help from Axinom Customer Support Team.
Posting here for future reference. Perhaps you can also add it to the official Bitmovin documentation as one of the examples of integration.
fairplay: {
LA_URL: LICENSE_SERVER_PROD_FAIRPLAY,
headers: {
'X-AxDrm-Message': drmtoken,
'Content-type': 'application/octet-stream'
},
certificateURL: FAIRPLAY_CERTIFICATE,
prepareContentId: (uri) => {
console.log("prepareContentId: ", uri);
return uri.substring(uri.indexOf("skd"));
},
prepareMessage: (event) => {
console.log("prepareMessage: ", event);
return new Blob([event.message], { type: 'application/octet-binary' });
},
prepareLicenseAsync: (ckc) => {
console.log("prepareLicense: ", ckc);
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.addEventListener('loadend', () => resolve(new Uint8Array(reader.result)));
reader.addEventListener('error', () => reject(reader.error));
reader.readAsArrayBuffer(ckc);
});
},
licenseResponseType: bitmovin.player.HttpResponseType.BLOB,
useUint16InitData: true
Cheers,
Łukasz
Thanks @Lukasz.Bajorski !
We will consider adding this!
system
(system)
Closed
September 12, 2024, 11:55am
7
This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.