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 class
OfflineLicenseManager.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.DrmException
getDrmError()
Deprecated.byte[]
getOfflineLicenseKeySetId()
Deprecated.byte[]
getPropertyByteArray(java.lang.String propertyName)
java.lang.String
getPropertyString(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.void
releaseLicense(byte[] licenseKeySetId)
Releases an offline license.void
releaseResources()
Releases the used resources.byte[]
renewLicense(byte[] licenseKeySetId)
Renews an offline license.void
setPropertyByteArray(java.lang.String propertyName, byte[] value)
void
setPropertyString(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.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 Detail
-
releaseResources
public void releaseResources()
Description copied from interface:LicenseManager
Releases the used resources.- Specified by:
releaseResources
in interfaceLicenseManager
-
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 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 DrmException
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
public void releaseLicense(@Nullable byte[] licenseKeySetId) throws DrmException
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<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. 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 public DrmException getDrmError()
Deprecated.- Specified by:
getDrmError
in interfaceBrightcoveDrmSession
-
queryKeyStatus
@Deprecated public java.util.Map<java.lang.String,java.lang.String> queryKeyStatus()
Deprecated.- Specified by:
queryKeyStatus
in interfaceBrightcoveDrmSession
-
getOfflineLicenseKeySetId
@Deprecated public byte[] getOfflineLicenseKeySetId()
Deprecated.- Specified by:
getOfflineLicenseKeySetId
in interfaceBrightcoveDrmSession
-
getPropertyString
public java.lang.String getPropertyString(java.lang.String propertyName)
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
public byte[] getPropertyByteArray(java.lang.String propertyName)
- Specified by:
getPropertyByteArray
in interfaceBrightcoveDrmSession
- See Also:
MediaDrm.getPropertyByteArray(String)
-
setPropertyString
public void setPropertyString(java.lang.String propertyName, java.lang.String value)
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
public void setPropertyByteArray(java.lang.String propertyName, byte[] value)
- Specified by:
setPropertyByteArray
in interfaceBrightcoveDrmSession
- See Also:
MediaDrm.setPropertyByteArray(String, byte[])
-
-