Class CustomerRightsToken

java.lang.Object
com.brightcove.player.drm.CustomerRightsToken

public class CustomerRightsToken extends Object
An immutable transfer object that can be set the absolute expiration and play duration when requesting an offline playback license.
  • Field Details

    • profile

      public final com.brightcove.player.drm.CustomerRightsToken.Profile profile
      The profile for the offline license request.
    • storeLicense

      public final Boolean storeLicense
      License persistence can be controlled via storeLicense field in the CustomerRightsToken. The effect of changing this value may vary with the DRM scheme, device and license type; for example, PlayReady rental licenses are required by specification to be persistent (in such case a false would be ignored). Some Widevine Modular devices also seem to require persistent rental licenses, else playback fails.
    • outputProtection

      public final OutputProtection outputProtection
  • Constructor Details

    • CustomerRightsToken

      public CustomerRightsToken(com.brightcove.player.drm.CustomerRightsToken.Profile profile, boolean storeLicense)
      Creates a new customers rights token.
      Parameters:
      profile - the profile for the offline license request.
      storeLicense - specifies whether the license is persistent
    • CustomerRightsToken

      public CustomerRightsToken(com.brightcove.player.drm.CustomerRightsToken.Profile profile, boolean storeLicense, @NonNull CustomerRightsTokenConfig config)
      Creates a new customers rights token.
      Parameters:
      profile - the profile for the offline license request.
      storeLicense - specifies whether the license is persistent.
      config - specifies extra and optional configuration.
  • Method Details

    • createRentalRightsToken

      @NonNull public static CustomerRightsToken createRentalRightsToken(@NonNull Date absoluteExpiration, @NonNull Long playDuration, boolean storeLicense)
      Creates a CustomerRightsToken for requesting a license with time restrictions.
      Parameters:
      absoluteExpiration - defines how long the license is valid to start playback.
      playDuration - defines in milliseconds how long the content can be consumed after the start of playback.
      storeLicense - specifies whether the license is persistent
      Returns:
      a custom rights token with the required license information.
    • createRentalRightsToken

      @NonNull public static CustomerRightsToken createRentalRightsToken(@NonNull Date absoluteExpiration, @NonNull Long playDuration)
      Creates a CustomerRightsToken for requesting a persistent license with the specified absolute expiration period
      Parameters:
      absoluteExpiration - defines how long the license is valid to start playback.
      playDuration - defines in milliseconds how long the content can be consumed after the start of playback.
      Returns:
      a custom rights token with the required license information.
    • createRentalRightsToken

      @NonNull public static CustomerRightsToken createRentalRightsToken(@NonNull Date absoluteExpiration, @NonNull Long playDuration, @NonNull CustomerRightsTokenConfig config)
      Creates a CustomerRightsToken for requesting a persistent license with the specified absolute expiration period
      Parameters:
      absoluteExpiration - defines how long the license is valid to start playback.
      playDuration - defines in milliseconds how long the content can be consumed after the start of playback.
      config - defines additional configuration for the CustomerRightsToken
      Returns:
      a custom rights token with the required license information.
    • createPurchaseRightsToken

      @NonNull public static CustomerRightsToken createPurchaseRightsToken()
      Creates a CustomerRightsToken for requesting a persistent license with a purchase profile
      Returns:
      a custom rights token with the required license information.
    • createPurchaseRightsToken

      @NonNull public static CustomerRightsToken createPurchaseRightsToken(@NonNull CustomerRightsTokenConfig config)
      Creates a CustomerRightsToken for requesting a persistent license with a purchase profile
      Parameters:
      config - defines additional configuration for the CustomerRightsToken
      Returns:
      a custom rights token with the required license information.