public interface LicenseManager
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CR_TOKEN_HEADER
The HTTP header name of the
CustomerRightsToken . |
Modifier and Type | Method and Description |
---|---|
byte[] |
downloadLicense(java.lang.String manifestUriString,
CustomerRightsToken customerRightsToken)
Downloads an offline license.
|
java.lang.String |
getPropertyString(java.lang.String key)
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.
|
void |
releaseLicense(byte[] licenseKeySetId)
Releases an offline license.
|
void |
releaseResources()
Releases the used resources.
|
byte[] |
renewLicense(byte[] licenseKeySetId)
Renews an offline license.
|
void |
setPropertyString(java.lang.String key,
java.lang.String value)
Sets the specified property.
|
static final java.lang.String CR_TOKEN_HEADER
CustomerRightsToken
.@Nullable byte[] downloadLicense(java.lang.String manifestUriString, @NonNull CustomerRightsToken customerRightsToken) throws java.io.IOException, java.lang.InterruptedException, DrmException
manifestUriString
- the URL to the DASH manifest file.customerRightsToken
- the customer rights token that describes the license type and limitations.java.io.IOException
- If an error occurs while attempt to read the manifest from the stream.java.lang.InterruptedException
- If the thread has been interrupted.DrmException
- Thrown when there is an error during DRM session.@Nullable byte[] renewLicense(byte[] licenseKeySetId) throws DrmException
licenseKeySetId
- The key set id of the license to be renewed.java.lang.IllegalStateException
- if the license key set identifier is null.DrmException
- Thrown when there is an error during DRM session.void releaseLicense(@Nullable byte[] licenseKeySetId) throws DrmException
licenseKeySetId
- The key set id of the license to be released.DrmException
- Thrown when there is an error during DRM session.@Nullable android.util.Pair<java.lang.Long,java.lang.Long> getRemainingLicenseDuration(byte[] licenseKeySetId) throws DrmException
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.licenseKeySetId
- The key set id of the license.java.lang.IllegalStateException
- if the license key set identifier is null.DrmException
void releaseResources()
void setPropertyString(java.lang.String key, java.lang.String value)
java.lang.String getPropertyString(java.lang.String key)