> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://fastpix.com/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://fastpix.com/docs/_mcp/server.

# Play DRM-protected content

> Play Widevine DRM-protected FastPix streams in the FastPix Android Player with a playback token and DrmConfig.

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](/docs/android-player/install-fastpix-android-player) and [Set up the player](/docs/android-player/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](/docs/video-security/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.

```kotlin
import io.fastpix.media3.core.DrmConfig
import io.fastpix.media3.core.FastPixPlayer
import io.fastpix.media3.core.StreamType

val player = FastPixPlayer.Builder(this)
    .setAutoplay(true)
    .build()
binding.playerView.player = player

player.setFastPixMediaItem {
    playbackId = "your-playback-id"
    streamType = StreamType.onDemand // Use StreamType.live for live streams
    playbackToken = "your-secure-playback-token"
    drmConfig = DrmConfig() // Defaults to Widevine UUID, multiSession=true
}
```

\


## Customize DRM options

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

```kotlin
import androidx.media3.common.C
import io.fastpix.media3.core.DrmConfig

player.setFastPixMediaItem {
    playbackId = "your-playback-id"
    playbackToken = "your-secure-playback-token"
    drmConfig = DrmConfig(
        uuid = C.WIDEVINE_UUID,
        multiSession = true
    )
}
```

\


## Things to know

* The current SDK DRM flow targets Widevine-protected FastPix HLS playback.
* The DRM token's audience is `"aud": "drm:<playbackId>"`. The same token authorizes both the stream and the licence request.
* `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 (code 9010) through `PlaybackListener.onError`.
* Pre-caching warms a DRM video's playlists and segments, but the Widevine licence is still requested on every play, so a warmed DRM video starts a few hundred milliseconds later than a clear one. See [Pre-cache videos before a player exists](/docs/android-player/pre-cache-videos).

\


#### Frequently asked questions

The FastPix Android Player SDK supports Widevine for protected FastPix HLS streams. The default `DrmConfig()` uses the Widevine UUID.

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`.

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.

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](/docs/android-player/enable-secure-video-playback) to protect non-DRM streams with playback tokens.
* [Set up DRM encryption](/docs/video-security/set-up-drm-encryption) to enable DRM on your FastPix account.