Class OfflineLicenseManager

    • Constructor Summary

      Constructors 
      Constructor Description
      OfflineLicenseManager​(com.google.android.exoplayer2.drm.ExoMediaDrm.Provider mediaDrm, com.google.android.exoplayer2.drm.MediaDrmCallback callback, java.util.HashMap<java.lang.String,​java.lang.String> optionalKeyRequestParameters, com.google.android.exoplayer2.drm.DrmSessionEventListener.EventDispatcher drmSessionEventDispatcher)
      Deprecated.
    • Constructor Detail

      • OfflineLicenseManager

        @Deprecated
        public OfflineLicenseManager​(com.google.android.exoplayer2.drm.ExoMediaDrm.Provider mediaDrm,
                                     com.google.android.exoplayer2.drm.MediaDrmCallback callback,
                                     java.util.HashMap<java.lang.String,​java.lang.String> optionalKeyRequestParameters,
                                     com.google.android.exoplayer2.drm.DrmSessionEventListener.EventDispatcher drmSessionEventDispatcher)
        Deprecated.
        Deprecated.
        Parameters:
        mediaDrm - An underlying ExoMediaDrm.Provider for use by the manager.
        callback - Performs key and provisioning requests.
        optionalKeyRequestParameters - An optional map of parameters to pass as the last argument to MediaDrm.getKeyRequest(byte[], byte[], String, int, HashMap). May be null.
        drmSessionEventDispatcher - A DrmSessionEventListener.EventDispatcher used to distribute DRM-related events.
    • Method Detail

      • downloadLicense

        @Nullable
        public byte[] downloadLicense​(java.lang.String manifestUriString,
                                      @NonNull
                                      CustomerRightsToken customerRightsToken)
                               throws java.io.IOException,
                                      DrmException
        Description copied from interface: LicenseManager
        Downloads an offline license.
        Specified by:
        downloadLicense in interface LicenseManager
        Parameters:
        manifestUriString - the URL to the DASH manifest file.
        customerRightsToken - the customer rights token that describes the license type and limitations.
        Returns:
        The downloaded offline license key set id.
        Throws:
        java.io.IOException - If an error occurs while attempt to read the manifest from the stream.
        DrmException - Thrown when there is an error during DRM session.
      • renewLicense

        @Nullable
        public byte[] renewLicense​(byte[] licenseKeySetId)
                            throws DrmException
        Description copied from interface: LicenseManager
        Renews an offline license.
        Specified by:
        renewLicense in interface LicenseManager
        Parameters:
        licenseKeySetId - The key set id of the license to be renewed.
        Returns:
        Renewed offline license key set id.
        Throws:
        DrmException - Thrown when there is an error during DRM session.
      • releaseLicense

        public void releaseLicense​(@Nullable
                                   byte[] licenseKeySetId)
                            throws DrmException
        Description copied from interface: LicenseManager
        Releases an offline license.
        Specified by:
        releaseLicense in interface LicenseManager
        Parameters:
        licenseKeySetId - The key set id of the license to be released.
        Throws:
        DrmException - Thrown when there is an error during DRM session.
      • getRemainingLicenseDuration

        @Nullable
        public android.util.Pair<java.lang.Long,​java.lang.Long> getRemainingLicenseDuration​(byte[] licenseKeySetId)
                                                                                           throws DrmException
        Description copied from interface: LicenseManager
        Returns license and playback durations remaining in seconds of the given offline license. The Pair.first value in the result will provide the remaining license duration as total number of seconds, while Pair.second value will provide the remain play duration as total number of seconds.
        Specified by:
        getRemainingLicenseDuration in interface LicenseManager
        Parameters:
        licenseKeySetId - The key set id of the license.
        Throws:
        DrmException
      • queryKeyStatus

        @Deprecated
        public java.util.Map<java.lang.String,​java.lang.String> queryKeyStatus()
        Deprecated.
        Specified by:
        queryKeyStatus in interface BrightcoveDrmSession
      • getPropertyByteArray

        public byte[] getPropertyByteArray​(java.lang.String propertyName)
        Specified by:
        getPropertyByteArray in interface BrightcoveDrmSession
        See Also:
        MediaDrm.getPropertyByteArray(String)
      • setPropertyByteArray

        public void setPropertyByteArray​(java.lang.String propertyName,
                                         byte[] value)
        Specified by:
        setPropertyByteArray in interface BrightcoveDrmSession
        See Also:
        MediaDrm.setPropertyByteArray(String, byte[])