DRM
Digital Rights Management (DRM) protects video content by encrypting its streams so that only authorized players can decrypt and play them.
Dailymotion uses DRM to ensure that only users with valid entitlements can access protected content.
Use this page to understand the DRM workflow and find the guide relevant to your integration.
DRM requirementDRM must be enabled on your organization. Reach out to your Dailymotion Success Manager or our Support team.
Supported DRM systems
The Dailymotion Player supports the following DRM systems:
| DRM system | Main platforms and browsers |
|---|---|
| Widevine | Chrome, Firefox, Android, Edge |
| FairPlay | Safari, iOS, macOS |
| PlayReady | Edge, Windows, Xbox |
The Player automatically selects the appropriate DRM system for the user’s browser or device.
How DRM-protected playback works
const jwt = require('jsonwebtoken');
const { v4: uuidv4 } = require('uuid');
function generateDRMToken(videoId, privateKey) {
const iat = Math.floor(Date.now() / 1000);
const exp = iat + 300; // 5-minute expiration window
const jti = uuidv4();
const payload = {
videoId: videoId,
iat: iat,
exp: exp,
jti: jti
};
return jwt.sign(payload, privateKey, { algorithm: 'RS256' });
}const response = await fetch('/api/get-drm-token?videoId=YOUR_VIDEO_KID'
if (!response.ok) throw new Error(`Token request failed: ${response.status}`)
const { token } = await response.json();const player = await dailymotion
.createPlayer('player-wrapper');player.setDrmConfig({ token });player.loadContent({ video: YOUR_VIDEO_KID });DRM usage rules
DRM licenses can enforce several usage rules:
- Relative expiration: Defines how long a license remains valid after it is issued and before playback starts.
- VOD play duration: Defines how long a VOD remains playable after playback begins.
- Key rotation: Allows encryption keys to be changed during playback.
- Key rotation period: Defines how frequently encryption keys are changed.
These rules can be configured separately for VOD and livestream content through API v2. The available fields and values are described in Configure DRM protection with API v2.
1. Configure your DRM protection settings
Configure DRM defaults settings and content-specific settings through API v2.
You can do the following via the API v2:
- Register your RSA public key.
- Configure separate default settings for VOD and livestream content.
- Make DRM protection the default visibility setting for newly created VODs.
- Apply default DRM settings to VODs and livestreams.
- Override profile defaults for individual content.
Also available from Studioyou can also configure default DRM settings for VOD and livestream from your Dailymotion Studio. However, custom DRM settings for individual content is only available via API v2.
2. Implement DRM-protected playback
After configuring your DRM protection settings, implement the playback flow with the Dailymotion Player.
The Player integration requires a secure backend to generate signed playback JWTs. The token must be passed to setDrmConfig() before loading the protected content.
Updated about 1 hour ago
