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
-
Field Summary
Fields inherited from interface com.brightcove.player.drm.LicenseManager
CR_TOKEN_HEADER
-
Constructor Summary
ConstructorDescriptionOfflineLicenseManager
(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.void
releaseLicense
(byte[] licenseKeySetId) Releases an offline license.void
Releases the used resources.byte[]
renewLicense
(byte[] licenseKeySetId) Renews an offline license.void
setPropertyByteArray
(String propertyName, byte[] value) void
setPropertyString
(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.Provider
for 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.EventDispatcher
used to distribute DRM-related events.
-
-
Method Details
-
releaseResources
public void releaseResources()Description copied from interface:LicenseManager
Releases the used resources.- Specified by:
releaseResources
in interfaceLicenseManager
-
downloadLicense
@Nullable public byte[] downloadLicense(String manifestUriString, @NonNull CustomerRightsToken customerRightsToken) throws IOException, DrmException Description copied from interface:LicenseManager
Downloads an offline license.- Specified by:
downloadLicense
in 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:LicenseManager
Renews an offline license.- Specified by:
renewLicense
in 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:LicenseManager
Releases an offline license.- Specified by:
releaseLicense
in 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:LicenseManager
Returns license and playback durations remaining in seconds of the given offline license. ThePair.first
value in the result will provide the remaining license duration as total number of seconds, whilePair.second
value will provide the remain play duration as total number of seconds.- Specified by:
getRemainingLicenseDuration
in interfaceLicenseManager
- Parameters:
licenseKeySetId
- The key set id of the license.- Throws:
DrmException
-
getDrmError
Deprecated.- Specified by:
getDrmError
in interfaceBrightcoveDrmSession
-
queryKeyStatus
Deprecated.- Specified by:
queryKeyStatus
in interfaceBrightcoveDrmSession
-
getOfflineLicenseKeySetId
Deprecated.- Specified by:
getOfflineLicenseKeySetId
in interfaceBrightcoveDrmSession
-
getPropertyString
Description copied from interface:LicenseManager
Gets the specified property.- Specified by:
getPropertyString
in interfaceBrightcoveDrmSession
- Specified by:
getPropertyString
in interfaceLicenseManager
- See Also:
-
MediaDrm.getPropertyString(String)
-
getPropertyByteArray
- Specified by:
getPropertyByteArray
in interfaceBrightcoveDrmSession
- See Also:
-
MediaDrm.getPropertyByteArray(String)
-
setPropertyString
Description copied from interface:LicenseManager
Sets the specified property.- Specified by:
setPropertyString
in interfaceBrightcoveDrmSession
- Specified by:
setPropertyString
in interfaceLicenseManager
- See Also:
-
MediaDrm.setPropertyString(String, String)
-
setPropertyByteArray
- Specified by:
setPropertyByteArray
in interfaceBrightcoveDrmSession
- See Also:
-
MediaDrm.setPropertyByteArray(String, byte[])
-