Set up DRM encryption
Digital Rights Management (DRM) is an essential security feature for video content streamed via FastPix. By integrating DRM, you can prevent unauthorized content usage through methods like:
- Screen recording
- Screen sharing
- Downloading tools
With DRM, video segments are encrypted using MPEG Common Encryption in CBCS mode, employing AES symmetric encryption. Additionally, a license request is required to deliver a decryption key, enabling video playback.
FastPix supports the industry-standard DRM protocols for secure video delivery:
- Google Widevine: Android devices and Chrome browsers
- Microsoft PlayReady: Windows platforms, including Xbox
- Apple FairPlay: Apple devices (Safari browsers on macOS, iOS, and iPadOS)
NOTE:
DRM is enabled per account. To turn it on, contact FastPix at support@fastpix.com and we’ll guide you through setting up Widevine, PlayReady, and FairPlay, including obtaining a FairPlay certificate if you need one. See Configure DRM for your videos for the onboarding steps.
Configure DRM for your videos
Create a workspace for DRM testing
For the best results during our beta phase, we recommend creating a new, isolated workspace for testing DRM-protected content.
- Navigate to the Workspace tab in your dashboard to create a workspace.
- Copy your workspace key (e.g., 1049319898967698465).
- Send this key to FastPix support, and we’ll onboard you when slots are available.
Get your DRM configuration ID
After onboarding, we’ll send you a DRM configuration ID for your workspace. This ID can also be found in the Settings tab of your dashboard. You’ll need this ID when creating media with a DRM playback policy.
Example of a DRM configuration ID: 1fd649fe-b84e-494d-b4b3-118ad6c5e4d7
NOTE
This is an example, and you will receive a unique ID.
FairPlay DRM on Apple devices
To ensure DRM-protected content plays on Apple devices (Safari on macOS, or any browser on iOS/iPadOS), you must obtain a FairPlay certificate from Apple. Without this certificate, DRM-protected content will not be playable.
Once you’ve obtained the FairPlay certificate (.cer file), upload it to the DRM section under the Settings tab of your FastPix dashboard.
If you need help obtaining a FairPlay certificate, contact FastPix support for assistance.
Creating media with a DRM playback policy
Currently, DRM can only be applied to Video on Demand (VOD) content.
To create DRM-protected media, follow these steps:
- Obtain your DRM configuration ID: Make sure you have the DRM configuration ID from the previous step.
- Create media with DRM protection: Use the DRM configuration ID and set the accessPolicy to drm in your media creation request. Below is an example of the required JSON format for creating a DRM-protected media:
Note: To control which device security levels can play the content, or to allow offline downloads, add the
security_levelanddownloadclaims to the DRM token, not to this media creation request. See Control which devices can play withsecurity_leveland Offline downloads for DRM content.
Integrating DRM with a third-party player
If you’re not using the FastPix player, you can still integrate DRM-protected playback into third-party players that support industry-standard DRM systems like Widevine and FairPlay.
FastPix streams are fully compatible with any player that can handle HLS with CBCS encryption, and most players that implement Encrypted Media Extensions (EME) and Media Source Extensions (MSE) will work out of the box.
DRM License URL Formats
When integrating, you’ll need to use FastPix’s license and certificate endpoints, inserting the playbackId of your asset and a drmToken generated for the current session or user.
Widevine
FairPlay
Before using FairPlay, confirm that FairPlay support is enabled on your FastPix account.
- License URL:
- Certificate URL:
Integration examples
Below are working configurations for popular third-party players.
HLS.js (For Web)
Video.js (with videojs-contrib-eme) - For Web
Shaka Player (For Web)
iOS Native (AVPlayer with FairPlay)
To use FairPlay on iOS, configure AVURLAsset and implement AVAssetResourceLoaderDelegate to handle SPC (Server Playback Context) and CKC (Content Key Context) exchange. Use the following endpoints:
-
Certificate URL:
-
License URL:
Refer to Apple’s FairPlay documentation for detailed implementation.
VersaPlayer (For iOS)
ExoPlayer (For Android)
Supported & tested players
FastPix DRM is tested and confirmed to work with:
- HLS.js
- Video.js (with videojs-contrib-eme)
- Shaka Player
- iOS AVPlayer (FairPlay)
- VersaPlayer
- ExoPlayer (Android)
If your player supports Widevine, PlayReady, or FairPlay with CBCS encryption, there’s a strong chance it will work with FastPix DRM as well. We’re always expanding our test coverage - let us know if you’ve successfully integrated with another player so we can add it to our compatibility list.
Playback DRM Content with FastPix Player
If you’re using FastPix Player, the integration process is even simpler. FastPix Player handles license requests, decryption, and browser compatibility for you - with minimal setup.
How it works:
FastPix Player supports both Widevine and FairPlay natively. During playback, it:
- Automatically detects whether the video is encrypted.
- Sends a license request using the provided DRM token.
- Decrypts the video securely and plays it in the user’s browser.
Required tokens:
To play DRM-protected videos, you’ll need two secure JSON Web Tokens (JWTs):
token: Grants permission to stream the video.drm-token: Authorizes access to the DRM license server.
You can generate both tokens using the JWT Token Generator.
If you enable the “DRM License” feature during generation, you can use the same token for both fields.
Embed example
Here’s a minimal HTML snippet using FastPix Player for DRM-protected playback:
Replace the placeholders with:
YOUR-PLAYBACK-ID: The unique ID of your video assetYOUR-DRM-TOKEN: The token authorizing both playback and license access
Both token and drm-token are required. If either is missing or invalid, the player will display a clear error message to help you debug.
Browser support
FastPix Player’s DRM integration works across:
Offline downloads for DRM content
Add a download claim set to true in the DRM token payload to allow app-level offline downloads. Viewers can download the protected content inside your app and play it back later, with DRM still enforced. Because this is a token claim, you control it per viewer and per session when you sign the DRM token, not when you create the media.
App-level downloads are supported on:
- iOS: FairPlay
- Android: Widevine
For how to sign a DRM token, see Generate JWTs for secure media.
To set up app-level downloads, or if you need any additional support, reach out to us at support@fastpix.com.
Note: This is an app-level download handled by your iOS or Android app, not a static MP4 download. DRM-protected renditions are not available as static MP4 files. See Enable MP4 support for offline viewing for how static MP4 downloads work for non-DRM media.
DRM security levels (Widevine L1, L2, L3)
DRM-protected content can play on some devices and be capped or blocked on others, depending on the device’s DRM security level. Whether playback is allowed for a given security level is part of the DRM configuration FastPix sets up for your account. Reach out to FastPix with your requirements, and we configure which security levels are allowed to play your content.
A security level describes where the sensitive work happens: decrypting the license key, decrypting the video, and handling the decoded frames. This runs either inside a hardware Trusted Execution Environment (TEE), an isolated part of the chip the operating system cannot read, or in normal software memory. The level is fixed in the device, so no app or setting can change it.
The three Widevine levels
In practice, almost every device is either L1 or L3. L1 covers devices built for the living room and modern mobile, where secure hardware exists, so they play up to 4K. L3 covers general-purpose computers, so desktop browsers using Widevine are usually capped at or below 1080p.
FastPix supports all three, so a viewer is served whichever one their device uses.
When you create DRM media, set maxResolution for the quality you want to allow. If you want to cap the resolution served to lower-security (L3) devices below what L1 devices receive, enforce that cap on your end.
Control which devices can play with security_level
Add a security_level claim to the DRM token payload to set which device security levels are allowed to play the content. This applies to Widevine only, and because it is a token claim, you set it per viewer and per session when you sign the DRM token.
Set security_level to 1 to allow playback on Widevine L1 devices only. If you omit security_level, playback is allowed on both Widevine L1 and L3 devices. This applies to Widevine only.
- L1 applies to the Flutter and Android native players, where decryption runs in the device’s secure hardware.
- L3 applies to software decryption, such as desktop browsers.
For how to sign a DRM token, see Generate JWTs for secure media.
Block rooted devices for extra security
Detecting whether a device is rooted or jailbroken is a check you configure in your own app, not in FastPix. Because a rooted device can report a lower DRM security level, use this check to decide whether to allow or block playback in your app, on top of DRM.
Testing DRM protection
To verify that DRM is functioning correctly, take a screenshot of the video playback. If DRM is properly enforced, the video should either be replaced by a black screen or display a single frame from the beginning of the video (instead of the actual content).
Need help?
Whether you’re using FastPix Player or a third-party player, we’re here to help you set up DRM right.
Email support@fastpix.com for token generation tips, license configuration, or FairPlay certificate assistance.