Class DrmLicenseLoader


  • public class DrmLicenseLoader
    extends Object
    Use the DrmLicenseLoader.Builder to create instances of the license loader. The loader works asynchronously and you need to provide a callback implementation to be informed about potential error and the successful license deliveries.

    Please note that you need to specify a unique ID for the DRM configuration DrmConfiguration.offlineId and configure the local key storage accordingly (see PlayerSDK.DEFAULT_KEY_STORE).

    Since:
    3.0.2
    • Method Detail

      • fetchLicense

        public static boolean fetchLicense​(@NonNull
                                           Bundle playbackBundle,
                                           @NonNull
                                           KeyStore keyStore)
        Fetches the license and store it in the key store
        Parameters:
        playbackBundle - The playback bundle
        keyStore - The key store to use
        Returns:
        true if the fetch was successful and otherwise false
      • fetchLicense

        public static boolean fetchLicense​(@NonNull
                                           PlayerConfig config,
                                           @NonNull
                                           KeyStore keyStore)
        Fetches the license and store it in the key store
        Parameters:
        config - The playback config
        keyStore - The key store to use
        Returns:
        true if the fetch was successful and otherwise false
      • load

        public void load()
        Triggers an asynchronous license loading. The license loading happens on a dedicated thread in the background. The callback provided will be called to inform about errors or a successful license delivery.
        Throws:
        NullPointerException - if mandatory data are not specified
      • remove

        public void remove()
        Triggers an asynchronous license removal. The license loading happens on a dedicated thread in the background. The callback provided will be called to inform about errors or a successful license removal.

        Some DRM vendors, such as Widevine, require a request to be performed against the license delivery server. This is why Internet connection might be required.

        On license removal success, the corresponding key in the PlayerSDK.DEFAULT_KEY_STORE will also be removed.