How to integrate Panda Video's DRM via API?
In this article, we will detail the steps required to configure Panda Video DRM via API, how to obtain the necessary credentials, and how to generate the token for use in the player.
If you are not familiar with DRM Watermark, read this article to learn more about its features.
Step-by-Step
To start the integration, you will need the DRM group ID and the secret key.
This information can be obtained from the Panda Video dashboard by accessing the Security screen, clicking the "Integrate DRM" button, and selecting the API option.
Generating the JWT Token
The next step is to generate the JWT token (JSON Web Token), which will be used to ensure that DRM is correctly applied to the video.
The example below uses Node.js to create the token:
const JWT = require('jsonwebtoken');
const jwtObj = {
drm_group_id: "", // id do grupo de DRM
string1: "Licenciado para", // Primeiro campo
string2: "Nome: Fulano", // Segundo campo
string3: "CPF: XXXXXXXXXXX" // Terceiro campo
}
const expiresIn = 86400; // 24 horas em segundos
const secret = "" // chave secreta do grupo de DRM
const token = JWT.sign(jwtObj, secret, { expiresIn }) // token gerado
string
fields with user information.Adding the Token to the Player Embed
With the token generated, the next step is to attach it to the embed code of the player, allowing DRM to be applied to the video. Just add the token as a parameter in the src
of the iframe, right after the video ID, using the watermark
parameter.
<!-- SUBSTITUA O CÓDIGO EMBED -->
<iframe
id="panda-9e8936e9-99d3-4af8-adaa-f17747c258db"
src="https://player-vz-82493b0a-26d.tv.pandavideo.com.br/embed/?v=9e8936e9-99d3-4af8-adaa-f17747c258db&watermark=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkcm1fZ3JvdXBfaWQiOiIzNzYxMDA1ZC02YzJkLTRmYTAtOTc4OS1iYjBhMGEwNGI0NWUiLCJzdHJpbmcxIjoiTGljZW5jaWFkbyBwYXJhIiwic3RyaW5nMiI6IkZ1bGFubyIsInN0cmluZzMiOiJYWFhYWFhYWCIsImV4cCI6MTY2ODA4NzE4OTQyMCwiYWxnIjoiSFMyNTYifQ.FJTAogcH_u2WilDD-99LI2hV59mLQ5kf1ELc48XVhoA"
style="border:none;position:absolute;top:0;left:0;"
allow="accelerometer;gyroscope;autoplay;encrypted-media;picture-in-picture"
allowfullscreen=true
width="100%"
height="100%">
</iframe>
Validating the Token
To verify that the JWT token is being generated correctly, you can use tools such as JWT.io or test the validation directly via API.
How to Change the DRM Security Level from Advanced to Regular (via API)
You can change the security level of your DRM from Advanced to Regular directly through the Panda Video API.
To make the change, send a PUT request to the endpoint that updates the DRM group properties. In the request body, you need to specify the security_level
parameter as "regular" to switch to the Regular level.
For more details, refer to the complete DRM group update documentation.
Got any questions?
If you have any questions during the integration process or need additional assistance, our support team is available to help you.
Not using Panda Video yet? Visit our [pricing page]() and choose the plan that’s right for your business. Who knows, you might become the next little panda! 🐼
Updated on: 07/28/2025
Thank you!