Package com.castlabs.android.drm

## Class DrmTodayConfiguration

- java.lang.Object
- - com.castlabs.android.drm.DrmConfiguration
  - - com.castlabs.android.drm.DrmTodayConfiguration

- All Implemented Interfaces:
    `Parcelable`

      public class DrmTodayConfiguration
      extends DrmConfiguration
      implements Parcelable

  This class contains the configuration parameters necessary to use DRMtoday with the player. Please use the `DrmTodayConfiguration.Builder` to create instances of this class.
  Since:
    3.0.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `DrmTodayConfiguration.Builder` | A builder implementation to create instances of `DrmTodayConfiguration`s
    `static interface` | `DrmTodayConfiguration.Environment` |

    - ### Nested classes/interfaces inherited from interface android.os.Parcelable

      `Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>`

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `List<String>` | `additionalAssetIds` | Optional additional assetIds for content with tracks encrypted with different keys
    `String` | `assetId` | The asset ID
    `String` | `authToken` | The DRMToday auth token
    `static Parcelable.Creator<DrmTodayConfiguration>` | `CREATOR` | The Parcel creator
    `static Map<Drm,​String>` | `DRMTODAY_ONBOARD_PATHS` | This map is used for DRMtoday Onboard to configure the paths for the different DRM systems.
    `static String` | `DRMTODAY_PRODUCTION` | Base URI for the DRMToday production environment
    `static String` | `DRMTODAY_STAGING` | Base URI for the DRMToday staging environment
    `static String` | `DRMTODAY_TEST` | Base URI for the DRMToday test environment
    `String` | `drmTodayMobileRoapUrl` | The DRMToday Mobile roap url
    `boolean` | `isDRMTodayMobile` | Set to true for DRMToday Mobile configurations
    `String` | `merchant` | The merchant
    `String` | `requestId` | The request ID
    `String` | `sessionId` | The session ID
    `String` | `userId` | The user ID
    `String` | `variantId` | The variant ID

    - ### Fields inherited from class com.castlabs.android.drm.DrmConfiguration

      `audioDrm, drm, forceWidevineL3, keyRotation, mediaDrmProperties, offlineId, playClearSamplesWithoutKeys, renewalThresholdMs, requestParameters, url`

    - ### Fields inherited from interface android.os.Parcelable

      `CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `describeContents()` |
    `String` | `getCustomDataJSON()` |
    `String` | `getOmaActivationServerUrl()` | This returns a custom OMA activation server URL if DRMtoday Onboard is used and a custom URL is configured.
    `String` | `getUrl()` |
    `String` | `toString()` |
    `void` | `writeToParcel​(Parcel dest, int flags)` |

    - ### Methods inherited from class com.castlabs.android.drm.DrmConfiguration

      `equals, getSecurityLevel, hashCode, renewalEnabled, resolvedAudioDrm, resolvedDrm`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### DRMTODAY_PRODUCTION

          public static final String DRMTODAY_PRODUCTION

      Base URI for the DRMToday production environment
      See Also:
        Constant Field Values

    - #### DRMTODAY_STAGING

          public static final String DRMTODAY_STAGING

      Base URI for the DRMToday staging environment
      See Also:
        Constant Field Values

    - #### DRMTODAY_TEST

          public static final String DRMTODAY_TEST

      Base URI for the DRMToday test environment
      See Also:
        Constant Field Values

    - #### DRMTODAY_ONBOARD_PATHS

          public static final Map<Drm,​String> DRMTODAY_ONBOARD_PATHS

      This map is used for DRMtoday Onboard to configure the paths for the different DRM systems. The map contains an encoded URL path that will be appended to the base URL for the specific DRM system. The defaults are:

      - OMA: `cmmlaoma/`
      - Widevine: `widevine/`
      - Playready: `Rightsmanager.asmx`

    - #### CREATOR

          public static final Parcelable.Creator<DrmTodayConfiguration> CREATOR

      The Parcel creator

    - #### userId

          @NonNull
          public final String userId

      The user ID

    - #### sessionId

          @NonNull
          public final String sessionId

      The session ID

    - #### merchant

          @NonNull
          public final String merchant

      The merchant

    - #### assetId

          @Nullable
          public final String assetId

      The asset ID

    - #### requestId

          @NonNull
          public final String requestId

      The request ID

    - #### authToken

          @Nullable
          public final String authToken

      The DRMToday auth token

    - #### variantId

          @Nullable
          public final String variantId

      The variant ID

    - #### isDRMTodayMobile

          public final boolean isDRMTodayMobile

      Set to true for DRMToday Mobile configurations

    - #### drmTodayMobileRoapUrl

          @Nullable
          public final String drmTodayMobileRoapUrl

      The DRMToday Mobile roap url

    - #### additionalAssetIds

          @Nullable
          public final List<String> additionalAssetIds

      Optional additional assetIds for content with tracks encrypted with different keys

  - ### Method Detail

    - #### describeContents

          public int describeContents()

      Specified by:
        `describeContents` in interface `Parcelable`
      Overrides:
        `describeContents` in class `DrmConfiguration`

    - #### writeToParcel

          public void writeToParcel​(Parcel dest,
                                    int flags)

      Specified by:
        `writeToParcel` in interface `Parcelable`
      Overrides:
        `writeToParcel` in class `DrmConfiguration`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `DrmConfiguration`

    - #### getCustomDataJSON

          public String getCustomDataJSON()

      Returns:
        generated JSON to provide to the MediaDrm callbacks.

    - #### getUrl

          public String getUrl()

      Returns:
        The URL to the backend for the selected DRM

    - #### getOmaActivationServerUrl

          @NonNull
          public String getOmaActivationServerUrl()

      This returns a custom OMA activation server URL if DRMtoday Onboard is used and a custom URL is configured.
      Returns:
        Activation server url or empty string