This guide provides a basic setup for integrating Shaka Player with bunny.net. For advanced configurations and customizations, refer to the Shaka Player documentation.
What you’ll need
Before you dive in, make sure you have the following prerequisites in place:- A bunny.net account ( Log in or sign up for a free trial).
HTML setup
First, create an HTML file and add a<video> element where the Shaka Player will attach. Include the Shaka Player library in your HTML file.
JavaScript setup
To integrate Widevine with Shaka Player, add the following code snippet after initializing the Shaka Player. This configuration includes fetching the certificate and configuring the license server URL: First, we setup the variables to set streamApi endpoint, library, and video information:theLightslibrary has Enterprise DRM configured, prepare a Fairplay certificate, license URLs, and the Widevine license URL:
initPlayer function. The segments that are related to DRM are only needed if Enterprise DRM is enabled on the video library: