com.brightcove.player.drm

## Class BrightcoveMediaDrmCallback

- java.lang.Object
- - com.brightcove.player.drm.BrightcoveMediaDrmCallback

- Direct Known Subclasses:
    WidevineMediaDrmCallback

      public class BrightcoveMediaDrmCallback
      extends java.lang.Object

  Provides a base implementation of Media DRM callback handler that can be used to concrete implementations specific to ExoPlayer/CDM.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static java.lang.String` | `BRIGHTCOVE_BASE_URL` The base URL to Brightcove DRM license service.
    `static java.lang.String` | `DEFAULT_URL` The name of the property in the video properties map that specified the default URL to the DRM license service that should be used if the request does not include an URL.
    `protected java.lang.String` | `defaultUrl` The fully qualified URL to the DRM license service that will be used if the request does include an URL.
    `protected static java.util.Map<java.lang.String,java.lang.String>` | `REQUEST_HEADERS` A map of HTTP headers that should be added to the license request.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `BrightcoveMediaDrmCallback(java.lang.String defaultUrl)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addOptionalHeaders(java.util.Map<java.lang.String,java.lang.String> optionalHeaders)` Adds the optional request headers that must be passed to the license key request.
    `java.util.Map<java.lang.String,java.lang.String>` | `getOptionalHeaders()` Gets the optional request headers that will be passed to the license key request.
    `protected void` | `setLicenseRequestHeaders(java.util.Map<java.lang.String,java.lang.Object> videoProperties)`
    `void` | `setOptionalHeaders(java.util.Map<java.lang.String,java.lang.String> optionalHeaders)` Sets the optional request headers that must be passed to the license key request.
    `protected void` | `setVideoHeaders(java.util.Map<java.lang.String,java.lang.Object> videoProperties)` Deprecated. Use `setLicenseRequestHeaders(Map)` instead

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

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

- - ### Field Detail

    - #### DEFAULT_URL

          public static final java.lang.String DEFAULT_URL

      The name of the property in the video properties map that specified the default URL to the DRM license service that should be used if the request does not include an URL.
      See Also:
        Constant Field Values

    - #### REQUEST_HEADERS

          protected static final java.util.Map<java.lang.String,java.lang.String> REQUEST_HEADERS

      A map of HTTP headers that should be added to the license request.

    - #### BRIGHTCOVE_BASE_URL

          protected static final java.lang.String BRIGHTCOVE_BASE_URL

      The base URL to Brightcove DRM license service.
      See Also:
        Constant Field Values

    - #### defaultUrl

          protected final java.lang.String defaultUrl

      The fully qualified URL to the DRM license service that will be used if the request does include an URL.

  - ### Constructor Detail

    - #### BrightcoveMediaDrmCallback

          protected BrightcoveMediaDrmCallback(@Nullable
                                               java.lang.String defaultUrl)

  - ### Method Detail

    - #### getOptionalHeaders

          @Nullable
          public java.util.Map<java.lang.String,java.lang.String> getOptionalHeaders()

      Gets the optional request headers that will be passed to the license key request.
      Returns:
        null or reference to an immutable map of request headers.

    - #### setOptionalHeaders

          public void setOptionalHeaders(@Nullable
                                         java.util.Map<java.lang.String,java.lang.String> optionalHeaders)

      Sets the optional request headers that must be passed to the license key request.
      Parameters:
        `optionalHeaders` - null or reference to an immutable map of request headers.

    - #### addOptionalHeaders

          public void addOptionalHeaders(@NonNull
                                         java.util.Map<java.lang.String,java.lang.String> optionalHeaders)

      Adds the optional request headers that must be passed to the license key request.
      Parameters:
        `optionalHeaders` - The map of headers to be added.

    - #### setVideoHeaders

          @Deprecated
          protected void setVideoHeaders(@NonNull
                                                     java.util.Map<java.lang.String,java.lang.Object> videoProperties)

      Deprecated. Use `setLicenseRequestHeaders(Map)` instead
      Sets the Video widevine headers from the videoProperties if available, through the `Video.Fields#WIDEVINE_HEADERS` key.
      Parameters:
        `videoProperties` - the video properties.
      See Also:
        `setOptionalHeaders(Map)`

    - #### setLicenseRequestHeaders

          protected void setLicenseRequestHeaders(@NonNull
                                                  java.util.Map<java.lang.String,java.lang.Object> videoProperties)