Enum DrmScheme

java.lang.Object
java.lang.Enum<DrmScheme>
com.codename1.media.DrmScheme
All Implemented Interfaces:
Comparable<DrmScheme>

public enum DrmScheme extends Enum<DrmScheme>

A content protection scheme a StreamRequest can ask the platform player to honour. Not every platform plays every scheme; ask MediaManager.isDrmSupported(DrmScheme) first and pick the strongest scheme the device answers yes to.

A streaming service usually packages each title once with CENC and serves it with whichever scheme the requesting device supports: FairPlay to Apple devices, Widevine to Android, and HLS AES-128 where neither is available.

  • Enum Constant Details

    • AES_128

      public static final DrmScheme AES_128
      HLS segment encryption with the key fetched from the URI of the playlist's #EXT-X-KEY tag. Every native player that plays HLS decrypts it, so it works on the most devices. The key reaches the client in the clear (over TLS), which makes it a deterrent rather than hardware-backed protection: guard the key URL with a short-lived, per-session token.
    • CLEARKEY

      public static final DrmScheme CLEARKEY
      The W3C ClearKey key system: CENC-encrypted media with keys delivered as a JSON Web Key set. The same packaging as Widevine without a license vendor, which makes it the scheme to develop and test a license server against.
    • WIDEVINE

      public static final DrmScheme WIDEVINE
      Google Widevine, the protection Android devices implement, with hardware-backed keys (L1) on most phones.
    • FAIRPLAY

      public static final DrmScheme FAIRPLAY
      Apple FairPlay Streaming, the protection iOS, iPadOS and tvOS implement. Needs the application certificate from Apple's FairPlay program, set with DrmConfig.setCertificateUrl(String).
  • Method Details

    • values

      public static DrmScheme[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static DrmScheme valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null