Package com.google.android.exoplayer2.drm

## Class DrmUtil

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

-     public final class DrmUtil
      extends Object

  DRM-related utility methods.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static interface` | `DrmUtil.ErrorSource` | Identifies the operation which caused a DRM-related error.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static int` | `ERROR_SOURCE_EXO_MEDIA_DRM` | Corresponds to failures caused by an `ExoMediaDrm` method call.
    `static int` | `ERROR_SOURCE_LICENSE_ACQUISITION` | Corresponds to failures caused by an operation related to obtaining DRM licenses.
    `static int` | `ERROR_SOURCE_PROVISIONING` | Corresponds to failures caused by an operation related to provisioning the device.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static @com.google.android.exoplayer2.PlaybackException.ErrorCode int` | `getErrorCodeForMediaDrmException​(Exception exception, @com.google.android.exoplayer2.drm.DrmUtil.ErrorSource int errorSource)` | Returns the `PlaybackException.ErrorCode` that corresponds to the given DRM-related exception.

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

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

- - ### Field Detail

    - #### ERROR_SOURCE_EXO_MEDIA_DRM

          public static final int ERROR_SOURCE_EXO_MEDIA_DRM

      Corresponds to failures caused by an `ExoMediaDrm` method call.
      See Also:
        Constant Field Values

    - #### ERROR_SOURCE_LICENSE_ACQUISITION

          public static final int ERROR_SOURCE_LICENSE_ACQUISITION

      Corresponds to failures caused by an operation related to obtaining DRM licenses.
      See Also:
        Constant Field Values

    - #### ERROR_SOURCE_PROVISIONING

          public static final int ERROR_SOURCE_PROVISIONING

      Corresponds to failures caused by an operation related to provisioning the device.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getErrorCodeForMediaDrmException

          @ErrorCode
          public static @com.google.android.exoplayer2.PlaybackException.ErrorCode int getErrorCodeForMediaDrmException​(Exception exception,
                                                                                                                        @ErrorSource
                                                                                                                        @com.google.android.exoplayer2.drm.DrmUtil.ErrorSource int errorSource)

      Returns the `PlaybackException.ErrorCode` that corresponds to the given DRM-related exception.
      Parameters:
        `exception` - The DRM-related exception for which to obtain a corresponding `PlaybackException.ErrorCode`.
        `errorSource` - The `DrmUtil.ErrorSource` for the given `exception`.
      Returns:
        The `PlaybackException.ErrorCode` that corresponds to the given DRM-related exception.