Web: Bitmovin player example
To make your life easier Cloud DRM can be integrated with all major video players available in the market. We recommend using Bitmovin Player as a first choice. This player is not only easy to use, but also guarantees an optimal video playback experience.
If you are interested in integrating Bitmovin Player with Cloud DRM, you can find a detailed step-by-step guide by visiting the Bitmovin documentation page: https://developer.bitmovin.com/playback/docs/playing-protected-content-with-drmcloud. By following the guide, you will be able to seamlessly integrate Cloud DRM with Bitmovin Player, thus improving the security and quality of your video content.
Example for Widevine, PlayReady and FairPlay
JavaScript example:
var source = {
dash: "DASH_MANIFEST_URL",
hls: "HLS_MANIFEST_URL",
drm: {
widevine: {
LA_URL:
"https://TENANT_CODENAME.la.drm.cloud/acquire-license/widevine?brandGuid=BRAND_ID&userToken=USER_TOKEN",
},
playready: {
LA_URL:
"https://TENANT_CODENAME.la.drm.cloud/acquire-license/playready?brandGuid=BRAND_ID&userToken=USER_TOKEN",
},
fairplay: {
certificateURL:
"https://TENANT_CODENAME.la.drm.cloud/certificate/fairplay?brandGuid=BRAND_ID",
headers: {
"content-type": "application/x-www-form-urlencoded",
"x-drm-brandGuid": BRAND_ID,
"x-drm-usertoken": USER_TOKEN,
},
prepareContentId: (url) => {
const serverProcessSPCPath = url
.substring(1)
.replace("skd://", "https://");
const link = document.createElement("a");
link.href = serverProcessSPCPath;
return link.hostname;
},
prepareMessage: (event, session) => {
return (
"spc=" +
encodeURIComponent(event.messageBase64Encoded) +
"&assetId=" +
encodeURIComponent(session.contentId)
);
},
},
},
};
Please replace the following placeholders in the code:
- DASH_MANIFEST_URL: The URL to the DASH manifest (MPD) file.
- HLS_MANIFEST_URL: The URL to the HLS manifest (M3U8) file.
- BRAND_ID: Your brand ID, retrieved from the videokit.cloud dashboard.
- TENANT_CODENAME: Tenant name, retrieved from the videokit.cloud dashboard.
- USER_TOKEN: A JWT token signed with a shared secret that authorises a given license request.