Package com.brightcove.player.drm
Class OfflineLicenseManager
- java.lang.Object
-
- com.brightcove.player.drm.OfflineLicenseManager
-
- All Implemented Interfaces:
BrightcoveDrmSession,DrmSession,LicenseManager
public class OfflineLicenseManager extends java.lang.Object implements LicenseManager, DrmSession
Offline license helper can be used to download, renew and release offline playback licenses.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOfflineLicenseManager.Builder
-
Field Summary
-
Fields inherited from interface com.brightcove.player.drm.LicenseManager
CR_TOKEN_HEADER
-
-
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.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description byte[]downloadLicense(java.lang.String manifestUriString, CustomerRightsToken customerRightsToken)Downloads an offline license.DrmExceptiongetDrmError()Deprecated.byte[]getOfflineLicenseKeySetId()Deprecated.byte[]getPropertyByteArray(java.lang.String propertyName)java.lang.StringgetPropertyString(java.lang.String propertyName)Gets the specified property.android.util.Pair<java.lang.Long,java.lang.Long>getRemainingLicenseDuration(byte[] licenseKeySetId)Returns license and playback durations remaining in seconds of the given offline license.java.util.Map<java.lang.String,java.lang.String>queryKeyStatus()Deprecated.voidreleaseLicense(byte[] licenseKeySetId)Releases an offline license.voidreleaseResources()Releases the used resources.byte[]renewLicense(byte[] licenseKeySetId)Renews an offline license.voidsetPropertyByteArray(java.lang.String propertyName, byte[] value)voidsetPropertyString(java.lang.String propertyName, java.lang.String value)Sets the specified property.
-
-
-
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 underlyingExoMediaDrm.Providerfor use by the manager.callback- Performs key and provisioning requests.optionalKeyRequestParameters- An optional map of parameters to pass as the last argument toMediaDrm.getKeyRequest(byte[], byte[], String, int, HashMap). May be null.drmSessionEventDispatcher- ADrmSessionEventListener.EventDispatcherused to distribute DRM-related events.
-
-
Method Detail
-
releaseResources
public void releaseResources()
Description copied from interface:LicenseManagerReleases the used resources.- Specified by:
releaseResourcesin interfaceLicenseManager
-
downloadLicense
@Nullable public byte[] downloadLicense(java.lang.String manifestUriString, @NonNull CustomerRightsToken customerRightsToken) throws java.io.IOException, DrmExceptionDescription copied from interface:LicenseManagerDownloads an offline license.- Specified by:
downloadLicensein interfaceLicenseManager- 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 DrmExceptionDescription copied from interface:LicenseManagerRenews an offline license.- Specified by:
renewLicensein interfaceLicenseManager- 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 DrmExceptionDescription copied from interface:LicenseManagerReleases an offline license.- Specified by:
releaseLicensein interfaceLicenseManager- 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 DrmExceptionDescription copied from interface:LicenseManagerReturns license and playback durations remaining in seconds of the given offline license. ThePair.firstvalue in the result will provide the remaining license duration as total number of seconds, whilePair.secondvalue will provide the remain play duration as total number of seconds.- Specified by:
getRemainingLicenseDurationin interfaceLicenseManager- Parameters:
licenseKeySetId- The key set id of the license.- Throws:
DrmException
-
getDrmError
@Deprecated public DrmException getDrmError()
Deprecated.- Specified by:
getDrmErrorin interfaceBrightcoveDrmSession
-
queryKeyStatus
@Deprecated public java.util.Map<java.lang.String,java.lang.String> queryKeyStatus()
Deprecated.- Specified by:
queryKeyStatusin interfaceBrightcoveDrmSession
-
getOfflineLicenseKeySetId
@Deprecated public byte[] getOfflineLicenseKeySetId()
Deprecated.- Specified by:
getOfflineLicenseKeySetIdin interfaceBrightcoveDrmSession
-
getPropertyString
public java.lang.String getPropertyString(java.lang.String propertyName)
Description copied from interface:LicenseManagerGets the specified property.- Specified by:
getPropertyStringin interfaceBrightcoveDrmSession- Specified by:
getPropertyStringin interfaceLicenseManager- See Also:
MediaDrm.getPropertyString(String)
-
getPropertyByteArray
public byte[] getPropertyByteArray(java.lang.String propertyName)
- Specified by:
getPropertyByteArrayin interfaceBrightcoveDrmSession- See Also:
MediaDrm.getPropertyByteArray(String)
-
setPropertyString
public void setPropertyString(java.lang.String propertyName, java.lang.String value)Description copied from interface:LicenseManagerSets the specified property.- Specified by:
setPropertyStringin interfaceBrightcoveDrmSession- Specified by:
setPropertyStringin interfaceLicenseManager- See Also:
MediaDrm.setPropertyString(String, String)
-
setPropertyByteArray
public void setPropertyByteArray(java.lang.String propertyName, byte[] value)- Specified by:
setPropertyByteArrayin interfaceBrightcoveDrmSession- See Also:
MediaDrm.setPropertyByteArray(String, byte[])
-
-