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:


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.

1import io.fastpix.media3.core.DrmConfig
2import io.fastpix.media3.core.FastPixPlayer
3import io.fastpix.media3.core.StreamType
4
5val player = FastPixPlayer.Builder(this)
6 .setAutoplay(true)
7 .build()
8binding.playerView.player = player
9
10player.setFastPixMediaItem {
11 playbackId = "your-playback-id"
12 streamType = StreamType.onDemand // Use StreamType.live for live streams
13 playbackToken = "your-secure-playback-token"
14 drmConfig = DrmConfig() // Defaults to Widevine UUID, multiSession=true
15}

Customize DRM options

Pass a configured DrmConfig to set the DRM UUID and session behavior explicitly.

1import androidx.media3.common.C
2import io.fastpix.media3.core.DrmConfig
3
4player.setFastPixMediaItem {
5 playbackId = "your-playback-id"
6 playbackToken = "your-secure-playback-token"
7 drmConfig = DrmConfig(
8 uuid = C.WIDEVINE_UUID,
9 multiSession = true
10 )
11}

Things to know

  • The current SDK DRM flow targets Widevine-protected FastPix HLS playback.
  • streamType helps resolve the correct FastPix DRM license endpoint (on-demand or live).
  • Always test DRM streams on real devices, and target the Android API levels you support.
  • A playbackToken without a drmConfig produces a DRM configuration error through PlaybackListener.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