Package com.brightcove.player.drm
Class OfflineLicenseManager
java.lang.Object
com.brightcove.player.drm.OfflineLicenseManager
- All Implemented Interfaces:
BrightcoveDrmSession,DrmSession,LicenseManager
Offline license helper can be used to download, renew and release offline playback licenses.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface com.brightcove.player.drm.LicenseManager
CR_TOKEN_HEADER -
Constructor Summary
ConstructorsConstructorDescriptionOfflineLicenseManager(com.google.android.exoplayer2.drm.ExoMediaDrm.Provider mediaDrm, com.google.android.exoplayer2.drm.MediaDrmCallback callback, HashMap<String, String> optionalKeyRequestParameters, com.google.android.exoplayer2.drm.DrmSessionEventListener.EventDispatcher drmSessionEventDispatcher) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]downloadLicense(String manifestUriString, CustomerRightsToken customerRightsToken) Downloads an offline license.Deprecated.byte[]Deprecated.byte[]getPropertyByteArray(String propertyName) getPropertyString(String propertyName) Gets the specified property.getRemainingLicenseDuration(byte[] licenseKeySetId) Returns license and playback durations remaining in seconds of the given offline license.Deprecated.voidreleaseLicense(byte[] licenseKeySetId) Releases an offline license.voidReleases the used resources.byte[]renewLicense(byte[] licenseKeySetId) Renews an offline license.voidsetPropertyByteArray(String propertyName, byte[] value) voidsetPropertyString(String propertyName, String value) Sets the specified property.
-
Constructor Details
-
OfflineLicenseManager
@Deprecated public OfflineLicenseManager(com.google.android.exoplayer2.drm.ExoMediaDrm.Provider mediaDrm, com.google.android.exoplayer2.drm.MediaDrmCallback callback, HashMap<String, 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 Details
-
releaseResources
public void releaseResources()Description copied from interface:LicenseManagerReleases the used resources.- Specified by:
releaseResourcesin interfaceLicenseManager
-
downloadLicense
@Nullable public byte[] downloadLicense(String manifestUriString, @NonNull CustomerRightsToken customerRightsToken) throws IOException, DrmException Description 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:
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
Description 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
Description 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<Long,Long> getRemainingLicenseDuration(byte[] licenseKeySetId) throws DrmException Description 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.- Specified by:
getDrmErrorin interfaceBrightcoveDrmSession
-
queryKeyStatus
Deprecated.- Specified by:
queryKeyStatusin interfaceBrightcoveDrmSession
-
getOfflineLicenseKeySetId
Deprecated.- Specified by:
getOfflineLicenseKeySetIdin interfaceBrightcoveDrmSession
-
getPropertyString
Description copied from interface:LicenseManagerGets the specified property.- Specified by:
getPropertyStringin interfaceBrightcoveDrmSession- Specified by:
getPropertyStringin interfaceLicenseManager- See Also:
-
MediaDrm.getPropertyString(String)
-
getPropertyByteArray
- Specified by:
getPropertyByteArrayin interfaceBrightcoveDrmSession- See Also:
-
MediaDrm.getPropertyByteArray(String)
-
setPropertyString
Description copied from interface:LicenseManagerSets the specified property.- Specified by:
setPropertyStringin interfaceBrightcoveDrmSession- Specified by:
setPropertyStringin interfaceLicenseManager- See Also:
-
MediaDrm.setPropertyString(String, String)
-
setPropertyByteArray
- Specified by:
setPropertyByteArrayin interfaceBrightcoveDrmSession- See Also:
-
MediaDrm.setPropertyByteArray(String, byte[])
-