[DRM][FairPlay] Bitmovin Player + Axinom License Server

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