Package com.google.android.exoplayer2.drm

## Class DefaultDrmSessionManagerProvider

- java.lang.Object
- - com.google.android.exoplayer2.drm.DefaultDrmSessionManagerProvider

- All Implemented Interfaces:
    `DrmSessionManagerProvider`

      public final class DefaultDrmSessionManagerProvider
      extends Object
      implements DrmSessionManagerProvider

  Default implementation of `DrmSessionManagerProvider`.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DefaultDrmSessionManagerProvider()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `DrmSessionManager` | `get​(MediaItem mediaItem)` | Returns a `DrmSessionManager` for the given media item.
    `void` | `setDrmHttpDataSourceFactory​(HttpDataSource.Factory drmHttpDataSourceFactory)` | Sets the `HttpDataSource.Factory` to be used for creating `HttpMediaDrmCallbacks` which executes key and provisioning requests over HTTP.
    `void` | `setDrmUserAgent​(String userAgent)` | Sets the optional user agent to be used for DRM requests.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultDrmSessionManagerProvider

          public DefaultDrmSessionManagerProvider()

  - ### Method Detail

    - #### setDrmHttpDataSourceFactory

          public void setDrmHttpDataSourceFactory​(@Nullable
                                                  HttpDataSource.Factory drmHttpDataSourceFactory)

      Sets the `HttpDataSource.Factory` to be used for creating `HttpMediaDrmCallbacks` which executes key and provisioning requests over HTTP. If `null` is passed the `DefaultHttpDataSourceFactory` is used.
      Parameters:
        `drmHttpDataSourceFactory` - The HTTP data source factory or `null` to use `DefaultHttpDataSourceFactory`.

    - #### setDrmUserAgent

          public void setDrmUserAgent​(@Nullable
                                      String userAgent)

      Sets the optional user agent to be used for DRM requests.

      In case a factory has been set by `setDrmHttpDataSourceFactory(HttpDataSource.Factory)`, this user agent is ignored.

      Parameters:
        `userAgent` - The user agent to be used for DRM requests.

    - #### get

          public DrmSessionManager get​(MediaItem mediaItem)

      Description copied from interface: `DrmSessionManagerProvider`
      Returns a `DrmSessionManager` for the given media item.

      The caller is responsible for `preparing` the `DrmSessionManager` before use, and subsequently `releasing` it.

      Specified by:
        `get` in interface `DrmSessionManagerProvider`