Studio DRM and ExoPlayer provide a comprehensive approach to protecting your content with industry-standard Digital Rights Management (DRM). After enabling DRM on a property from your JWP dashboard and integrating with ExoPlayer, DRM decryption of the content will be managed by ExoPlayer and the OS.

For more information about the DRM workflow, refer to the <a href="https://docs.jwplayer.com/platform/docs/protection-studio-drm-overview#high-level-workflow-overview" target="_blank">High-Level Workflow Overview</a>.

<br />

ο»Ώ

For the following use cases, use [Studio DRM Standalone](πŸ”—ο»Ώ) with your current streaming and hosting solution:

  • Choosing not to enable Studio DRM with JW Platform

  • Implementing live stream integrations

<br />


ο»Ώ

## Requirements

<table> <thead> <tr> <th> Item </th> <th> Notes </th> </tr> </thead> <tbody> <tr> <td width="40%"> <strong>DRM entitlement</strong> </td> <td width="60%"> Contact your JWP representative for more information.</td> </tr> <tr> <td> <strong>DRM-enabled property</strong> </td> <td> See: <a href="/platform/docs/protection-studio-drm-get-started#enable-a-property" target="_blank">Enable a property</a></td> </tr> </tbody> </table>

<br />


ο»Ώ

## Implementation

ο»Ώ

We **strongly recommend** referring to and starting with our <a href="https://sdks.vudrm.tech/android/latest/studiodrm-android-exoplayer-del_api-offline-client-demo/ExoPlayer 2.18.2 Demo/studiodrm-demo-widevine.zip">Studio DRM with JW Platform and ExoPlayer demo</a> for Android and Android TV. This .zip file allows you to see both Google's recommended full working implementation and an example of how to manage the licensing of online and offline multiple assets.

<br />

Use the following steps to set up DRM playback in your Android app:

  1. Generate a <a href="https://docs.jwplayer.com/platform/docs/protection-studio-drm-generate-a-signed-content-url-for-drm-playback" target="_blank">signed URL for DRM playback</a>.

    ο»Ώ

    We **strongly recommend** using a proxy service to generate the JSON web token (JWT). If you generate the JWT within a client-side native app, you risk exposing your API secret.

<br />

  1. Make a `GET` call with the signed URL.<br /> From the signed content URL response, the code sample extracts the file title `(title)`, file URL `(playlist[].sources[].file)` and the license URL `(playlist[].sources[].drm.widevine.url)` from the `sources` array and populates the specific stream configuration with them.

    ο»Ώ

    The ordering of items within `playlist[].sources[]` is not static. Therefore, do not use a defined index `(playlist[].sources[0])` as part of your extraction process. The following code sample demonstrates how to locate the correct `playlist[].sources` index.

    Also, both the media URL and its associated license URL are valid for only **10 minutes from when they are requested.**

    ο»Ώ

<br />

  1. Create a list of `mediaItems` with the associated DRM configuration.

    ο»Ώ

<br />

  1. Initialize an ExoPlayer player using the list of `mediaItems`.

    ο»Ώ

<br />

  1. Create a list of `mediaItems` with associated DRM configuration and assign the list to a `DownloadTracker` and `DownloadRequest`.

    ο»Ώ

    Offline playback requires the following:

    • A `DownloadTracker` that tracks media that has been downloaded

    • A service for downloading media, such as a `DownloadService` <br /><br />

    Full examples of these classes and how to implement them are available in the <a href="https://sdks.vudrm.tech/android/latest/studiodrm-android-exoplayer-del_api-offline-client-demo/ExoPlayer 2.18.2 Demo/studiodrm-demo-widevine.zip">Studio DRM with JW Platform and ExoPlayer demo</a>.

    ο»Ώ

<br />

<!-- Removes the automatic page-to-page navigation at the bottom of the page -->

<style> .rm-Pagination { display: none; } </style>