Package com.castlabs.android.player
Class DrmLicenseLoader
java.lang.Object
com.castlabs.android.player.DrmLicenseLoader
Use the
DrmLicenseLoader.Builder
to create instances of the license loader. The loader works
asynchronously and you need to provide a callback implementation to be informed about
potential error and the successful license deliveries.
Please note that you need to specify a unique ID for the DRM configuration
DrmConfiguration.offlineId
and configure the local key storage accordingly (see
PlayerSDK.DEFAULT_KEY_STORE
).- Since:
- 3.0.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Use this builder class to generate new instances of theDrmLicenseLoader
.static interface
The callback interface for license loader tasks -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
fetchLicense
(Bundle playbackBundle, KeyStore keyStore) Fetches the license and store it in the key storestatic boolean
fetchLicense
(PlayerConfig config, KeyStore keyStore) Fetches the license and store it in the key storevoid
load()
Triggers an asynchronous license loading.void
remove()
Triggers an asynchronous license removal.
-
Method Details
-
fetchLicense
Fetches the license and store it in the key store- Parameters:
playbackBundle
- The playback bundlekeyStore
- The key store to use- Returns:
true
if the fetch was successful and otherwisefalse
-
fetchLicense
Fetches the license and store it in the key store- Parameters:
config
- The playback configkeyStore
- The key store to use- Returns:
true
if the fetch was successful and otherwisefalse
-
load
public void load()Triggers an asynchronous license loading. The license loading happens on a dedicated thread in the background. The callback provided will be called to inform about errors or a successful license delivery.- Throws:
NullPointerException
- if mandatory data are not specified
-
remove
public void remove()Triggers an asynchronous license removal. The license loading happens on a dedicated thread in the background. The callback provided will be called to inform about errors or a successful license removal.Some DRM vendors, such as Widevine, require a request to be performed against the license delivery server. This is why Internet connection might be required.
On license removal success, the corresponding key in the
PlayerSDK.DEFAULT_KEY_STORE
will also be removed.
-