Package com.castlabs.android.player
Class DrmLicenseLoader
- java.lang.Object
-
- com.castlabs.android.player.DrmLicenseLoader
-
public class DrmLicenseLoader extends Object
Use theDrmLicenseLoader.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 configurationDrmConfiguration.offlineId
and configure the local key storage accordingly (seePlayerSDK.DEFAULT_KEY_STORE
).- Since:
- 3.0.2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DrmLicenseLoader.Builder
Use this builder class to generate new instances of theDrmLicenseLoader
.static interface
DrmLicenseLoader.Callback
The callback interface for license loader tasks
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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 Detail
-
fetchLicense
public static boolean fetchLicense(@NonNull Bundle playbackBundle, @NonNull KeyStore keyStore)
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
public static boolean fetchLicense(@NonNull PlayerConfig config, @NonNull KeyStore keyStore)
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.
-
-