Package com.brightcove.player.drm
Interface LicenseManager
-
- All Known Implementing Classes:
OfflineLicenseManager
public interface LicenseManagerContract of license manager implementation that can be used to manage offline playback licenses.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCR_TOKEN_HEADERThe HTTP header name of theCustomerRightsToken.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]downloadLicense(java.lang.String manifestUriString, CustomerRightsToken customerRightsToken)Downloads an offline license.java.lang.StringgetPropertyString(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.voidreleaseLicense(byte[] licenseKeySetId)Releases an offline license.voidreleaseResources()Releases the used resources.byte[]renewLicense(byte[] licenseKeySetId)Renews an offline license.voidsetPropertyString(java.lang.String key, java.lang.String value)Sets the specified property.
-
-
-
Field Detail
-
CR_TOKEN_HEADER
static final java.lang.String CR_TOKEN_HEADER
The HTTP header name of theCustomerRightsToken.- See Also:
- Constant Field Values
-
-
Method Detail
-
downloadLicense
@Nullable byte[] downloadLicense(java.lang.String manifestUriString, @NonNull CustomerRightsToken customerRightsToken) throws java.io.IOException, java.lang.InterruptedException, DrmExceptionDownloads an offline license.- 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.java.lang.InterruptedException- If the thread has been interrupted.DrmException- Thrown when there is an error during DRM session.
-
renewLicense
@Nullable byte[] renewLicense(byte[] licenseKeySetId) throws DrmExceptionRenews an offline license.- Parameters:
licenseKeySetId- The key set id of the license to be renewed.- Returns:
- Renewed offline license key set id.
- Throws:
java.lang.IllegalStateException- if the license key set identifier is null.DrmException- Thrown when there is an error during DRM session.
-
releaseLicense
void releaseLicense(@Nullable byte[] licenseKeySetId) throws DrmExceptionReleases an offline license.- 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 android.util.Pair<java.lang.Long,java.lang.Long> getRemainingLicenseDuration(byte[] licenseKeySetId) throws DrmExceptionReturns 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.- Parameters:
licenseKeySetId- The key set id of the license.- Throws:
java.lang.IllegalStateException- if the license key set identifier is null.DrmException
-
releaseResources
void releaseResources()
Releases the used resources.
-
setPropertyString
void setPropertyString(java.lang.String key, java.lang.String value)Sets the specified property.
-
getPropertyString
java.lang.String getPropertyString(java.lang.String key)
Gets the specified property.
-
-