Class DrmTodayConfiguration.Builder

    • Method Detail

      • assetId

        public DrmTodayConfiguration.Builder assetId​(@NonNull
                                                     String assetId)
        Sets the assetId id. This overwrites the asset ID specified through the constructor call. You are encouraged to always specify a assetId, even for DRM setups where it is not strictly necessary.
        Parameters:
        assetId - the asset ID
        Returns:
        The builder
      • drmTodayMobile

        public DrmTodayConfiguration.Builder drmTodayMobile​(boolean value)
        Use this method to enable support for the DRMtoday-Mobile server.
        Parameters:
        value - the DRMTodayMobile flag value
        Returns:
        The builder
      • drmTodayMobileUrl

        public DrmTodayConfiguration.Builder drmTodayMobileUrl​(String url)
        If you are using DRM-today Mobile, use this method to specify the base URL for the DRM-today Mobile server.
        Parameters:
        url - The base URL to the DRMtoday-Mobile server
        Returns:
        The builder
      • additionalAssetIds

        public DrmTodayConfiguration.Builder additionalAssetIds​(@Nullable
                                                                List<String> ids)
        If you are using the DRMtoday-Mobile Server, you can use this method to specify a list of additional Asset Ids for content with tracks encrypted with different keys. Please note that this setting has an effect only when you are using the DRMtoday-Mobile server.
        Parameters:
        ids - The asset IDs
        Returns:
        The builder
      • playClearSamplesWithoutKeys

        public DrmTodayConfiguration.Builder playClearSamplesWithoutKeys​(boolean playClearSamplesWithoutKeys)
        If enabled and the stream contains clean samples at the beginning, the player will start playing while fetching the license key in background. This is true by default.
        Parameters:
        playClearSamplesWithoutKeys - play clear samples
        Returns:
        The builder
      • variantId

        public DrmTodayConfiguration.Builder variantId​(String variantId)
        Set the variant ID. This is null by default
        Parameters:
        variantId - the variant ID
        Returns:
        The builder
      • authToken

        public DrmTodayConfiguration.Builder authToken​(String authToken)
        Set the DRMToday auth token when you are using upfront authentication.
        Parameters:
        authToken - the DRMToday auth token
        Returns:
        The builder
      • offlineId

        public DrmTodayConfiguration.Builder offlineId​(@Nullable
                                                       String offlineId)
        Set the ID that will be used to store the offline key for this DRM configuration. If this is null, offline key storage will be disabled
        Parameters:
        offlineId - the ID used to store offline keys for this DRM configuration or null to disable offline key sotrage
        Returns:
        The builder
      • audioDrm

        public DrmTodayConfiguration.Builder audioDrm​(Drm audioDrm)
        Set a dedicated DRM system for audio tracks.
        Parameters:
        audioDrm - The DRM system used for audio tracks
        Returns:
        The builder
      • omaActivationServerUrl

        public DrmTodayConfiguration.Builder omaActivationServerUrl​(String omaActivationServerUrl)
        Set a dedicated Activation Server URL for OMA when using DRMtoday mobile. Note that this is only required if the activation server URL is different from the license server URL. The URL is used "as is".
        Parameters:
        omaActivationServerUrl - The DRM system used for audio tracks
        Returns:
        The builder
      • keyRotation

        public DrmTodayConfiguration.Builder keyRotation​(boolean enabled)
        Enforce Key-Rotation support also on older devices before Android M. This is primarily indented for live content with changing keys where we need to enable session sharing support on older devices to make sure we can rotate keys.
        Parameters:
        enabled - Enable key rotation
        Returns:
        The builder
      • renewalThreshold

        public DrmTodayConfiguration.Builder renewalThreshold​(long renewalThreshold,
                                                              TimeUnit timeUnit)
        If set to a non-negative value, the Widevine key renewal will be enabled and expiring license will be automatically renewed in renewalThreshold before expiration. Both license's expiration date-time and playback remaining time are taken into account. For instance, if the license has playback remaining of 60min and the renewalThreshold is set to 60sec then after 59min of playback the license will be renewed automatically.

        Note: offlineId(String) has to be set as well for the automatic renewals to work

        Note: if the DRM configuration needs to be updated for the subsequent license requests then the callback shall be installed via PlayerController.setConfigurationProvider(ConfigurationProvider)

        Parameters:
        renewalThreshold - The expiration threshold time value
        timeUnit - The time unit of the renewalThreshold
        Returns:
        The builder
      • forceWidevineL3

        public DrmTodayConfiguration.Builder forceWidevineL3​(boolean forceWidevineL3)
        If set to true, Widevine L3 will be enforced. Note that this will prevent playback of DRM content where the license requires L1 security.

        This flag can be set for certain devices that are known to have broken secure decoder implementation to allow Widevine protected content playback.

        Parameters:
        forceWidevineL3 - Force Widevine Level 3
        Returns:
        The builder
      • requestId

        public DrmTodayConfiguration.Builder requestId​(String requestId)
        Sets the request id. This is mainly designed to use for debugging purposes. Will be sent as "logRequestId" to the DRMToday backend. If left uninformed, a random request id will be generated.
        Parameters:
        requestId - the request id
        Returns:
        the Builder
      • mediaDrmProperties

        public DrmTodayConfiguration.Builder mediaDrmProperties​(@NonNull
                                                                Bundle mediaDrmProperties)
        Sets the mediaDrmProperties bundle
        Parameters:
        mediaDrmProperties - The properties of mediaDrm
        Returns:
        the Builder