Widevine HTML5 Integration
This guide provides step-by-step instructions on integrating Widevine with HTML5 video players. Widevine ensures secure playback and decryption of encrypted videos through the configuration of license server URLs.
What You'll Need
- A bunny.net account ( Log in or sign up for a free trial license).
- Ensure that the Media Cage DRM Enterprise feature is enabled in your account. If you need guidance on how to enable this feature, please refer to our Media Cage DRM Enterprise quickstart guide.
Use Licence Server URL with Video Players
To ensure the seamless playback of encrypted videos, it is crucial to configure the license server URL with your video players. The following section provides a code snippet for configuring license proxies with various widely used video players.
Shaka Player
Shaka Player is a JavaScript library for adaptive video streaming. To integrate Widevine with Shaka Player, add a following code snippet after initializing the shaka player. This configuration includes fetching the certificate and configuring the license server URL :
// MODIFY: You need to replace {library_id} and {video_id} with actual values
let wvLicenseUrl="https://video.bunnycdn.com/WidevineLicense/{library_id}/{video_id}";
shaka_player.configure({
drm: {
servers: {
'com.widevine.alpha': wvLicenseUrl
},
advanced: {
'com.widevine.alpha': {
'videoRobustness': 'SW_SECURE_CRYPTO',
'audioRobustness': 'SW_SECURE_CRYPTO'
}
}
}
});
Updated 10 days ago