Package com.brightcove.player.drm
Interface LicenseManager
- All Known Implementing Classes:
OfflineLicenseManager
public interface LicenseManager
Contract of license manager implementation that can be used to manage offline playback licenses.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The HTTP header name of theCustomerRightsToken
. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
downloadLicense
(String manifestUriString, CustomerRightsToken customerRightsToken) Downloads an offline license.getPropertyString
(String key) Gets the specified property.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
Releases the used resources.byte[]
renewLicense
(byte[] licenseKeySetId) Renews an offline license.void
setPropertyString
(String key, String value) Sets the specified property.
-
Field Details
-
CR_TOKEN_HEADER
The HTTP header name of theCustomerRightsToken
.- See Also:
-
-
Method Details
-
downloadLicense
@Nullable byte[] downloadLicense(String manifestUriString, @NonNull CustomerRightsToken customerRightsToken) throws IOException, InterruptedException, DrmException Downloads 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:
IOException
- If an error occurs while attempt to read the manifest from the stream.InterruptedException
- If the thread has been interrupted.DrmException
- Thrown when there is an error during DRM session.
-
renewLicense
Renews an offline license.- Parameters:
licenseKeySetId
- The key set id of the license to be renewed.- Returns:
- Renewed offline license key set id.
- Throws:
IllegalStateException
- if the license key set identifier is null.DrmException
- Thrown when there is an error during DRM session.
-
releaseLicense
Releases 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<Long,Long> getRemainingLicenseDuration(byte[] licenseKeySetId) throws DrmException 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.- Parameters:
licenseKeySetId
- The key set id of the license.- Throws:
IllegalStateException
- if the license key set identifier is null.DrmException
-
releaseResources
void releaseResources()Releases the used resources. -
setPropertyString
Sets the specified property. -
getPropertyString
Gets the specified property.
-