Play DRM-protected content
Play DRM-protected content
Play Widevine DRM-protected FastPix streams in the FastPix Android Player.
The FastPix Android Player SDK plays Widevine-protected HLS streams. To play a protected stream, provide both a playbackToken, which authorizes secure playback, and a drmConfig, which enables DRM on the media item. If you set a playbackToken without a drmConfig, playback fails with a DRM configuration error, reported through PlaybackListener.onError.
Before you begin
Make sure you have the following:
- The FastPix Android Player SDK installed and a player set up. See Install FastPix Android player and Set up the player.
- DRM enabled on your FastPix account, plus a playback token for the protected stream. To enable DRM and generate tokens, see Set up DRM encryption.
Set up basic DRM playback
Provide the playbackToken and a default drmConfig in your setFastPixMediaItem configuration. The default DrmConfig() targets the Widevine UUID with multiSession enabled. Use streamType so the SDK resolves the correct FastPix DRM license endpoint for on-demand or live content.
Customize DRM options
Pass a configured DrmConfig to set the DRM UUID and session behavior explicitly.
Things to know
- The current SDK DRM flow targets Widevine-protected FastPix HLS playback.
streamTypehelps resolve the correct FastPix DRM license endpoint (on-demandorlive).- Always test DRM streams on real devices, and target the Android API levels you support.
- A
playbackTokenwithout adrmConfigproduces a DRM configuration error throughPlaybackListener.onError.
Frequently asked questions
Which DRM systems does the Android player support?
The FastPix Android Player SDK supports Widevine for protected FastPix HLS streams. The default DrmConfig() uses the Widevine UUID.
Do I need both a playback token and a DrmConfig?
Yes. A protected stream needs the playbackToken to authorize playback and a drmConfig to enable DRM on the media item. Setting a playbackToken without a drmConfig results in a DRM configuration error through PlaybackListener.onError.
How do I play a live DRM stream?
Set streamType = StreamType.live in setFastPixMediaItem. The streamType value lets the SDK resolve the correct FastPix DRM license endpoint for live or on-demand content.
Why does DRM playback work in the emulator but fail on some devices?
DRM behavior depends on the device’s Widevine security level and Android version. Always test DRM streams on real devices across the API levels you support.
What’s next
- Enable secure video playback to protect non-DRM streams with playback tokens.
- Set up DRM encryption to enable DRM on your FastPix account.