# DRM on Android

THEOplayer supports FairPlay, PlayReady and Widevine by default. To use these DRM systems, you will need to pass a DRM configuration along with the `source` object. We are partnered with many multi-DRM vendors to make it as easy as possible to get your DRM streams running.

## Integrations

These DRM vendors can be used through an integration. An integration is not part of the SDK: it is added on top of it as a [custom DRM integration](#custom-integration). Ready-made integrations for many vendors are available in the [DRM integration samples repository](https://github.com/THEOplayer/samples-drm-integration). Vendors which don't require custom license or certificate requests can be used with a plain key system configuration instead.

* [Arris Titanium](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/arris-titanium.md)
* [BuyDRM KeyOS](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/buydrm-keyos.md)
* [DoveRunner](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/doverunner.md)
* [EZDRM](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/ezdrm.md)
* [Intertrust ExpressPlay](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/intertrust-expressplay.md)
* [Microsoft Azure](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/microsoft-azure.md)
* [Uplynk](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/uplynk.md)
* [Verimatrix MultiRights](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/verimatrix-multirights.md)
* [Vimond](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/vimond.md)
* [Vualto VuDRM](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/vualto-vudrm.md)

## Pre-integrations

THEOplayer is also pre-integrated with a number of commercial multi-DRM vendors. These pre-integrations are part of the SDK itself: you select the vendor and pass its parameters, and the SDK takes care of the vendor's license and certificate requests. When integrating DRM for the first time or updating your integration, an integration is preferred over a pre-integration.

* [Arris Titanium](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/arris-titanium.md)
* [Axinom](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/axinom.md)
* [BuyDRM KeyOS](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/buydrm-keyos.md)
* [castLabs DRMToday](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/castlabs-drmtoday.md)
* [Irdeto](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/irdeto.md)
* [Microsoft Azure](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/microsoft-azure.md)
* [Nagra Conax Contego](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/nagra-conax-contego.md)
* [Vualto VuDRM](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/vualto-vudrm.md)
* [Xstream](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/xstream.md)

## Other guides

* [Clear Key](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/clear-key.md): how to play a Clear Key protected stream.
* [Offline DRM](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/offline-drm.md): how to implement playback of downloadable content-protected streams.
* [Customizing offline DRM notifications](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/offline-drm-notifications.md)
* [Multi-key HLS](https://docs-preview.optiview.dolby.com/pr-863/theoplayer/how-to-guides/android/drm/multikey-hls.md): how to serve one HLS stream to all key systems.

## Custom configuration

Developers can use the generic DRM-functionalities in case in-house DRM-solutions are used, or services from DRM-vendors for which no integration is available.

To configure DRM on the Android SDK, developers can put a DRMConfiguration inside a SourceDescription.

```java
// Map<String, String> headers =  new HashMap<String, String>();
// headers.put("<KEY>", "<VALUE>");
DRMConfiguration drmConfiguration = new DRMConfiguration.Builder()
    .widevine(
        new KeySystemConfiguration.Builder(
            "<LICENSE_KEY_URL_WIDEVINE>"
            )// , headers, <USE_CREDENTIALS>, <QUERY_PARAMETERS>
            .build()
        )
        .build();
TypedSource typedSource = new TypedSource.Builder("<DASH_STREAM_URL>")
    .drm(drmConfiguration)
    .build();
SourceDescription sourceDescription = new SourceDescription.Builder(typedSource)
    .build();
theoplayer.getPlayer().setSource(sourceDescription);
```

## Custom integration

Developers can make their own custom DRM integration for any DRM vendor. This can be done by making use of the [DRM integration API repository](https://github.com/THEOplayer/samples-drm-integration).

A complete guide on how to create a new integration, and some example integrations can be found in the provided repository.
