Package com.castlabs.android.drm
Interface DrmLicenseManager
- All Superinterfaces:
com.google.android.exoplayer2.drm.DrmSessionManager
public interface DrmLicenseManager
extends com.google.android.exoplayer2.drm.DrmSessionManager
Extension of the
DrmSessionManager that also allows to load licenses
headless and in one blocking function.- Since:
- 3.0.2
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.drm.DrmSessionManager
com.google.android.exoplayer2.drm.DrmSessionManager.DrmSessionReference -
Field Summary
Fields inherited from interface com.google.android.exoplayer2.drm.DrmSessionManager
DRM_UNSUPPORTED, DUMMY -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close all sessionsvoidfetchLicence(com.google.android.exoplayer2.Format format, DrmConfiguration drmConfiguration) Used for pre-fetching a DRM License.Returns whichTrackRendererPlugin.Typeof Tracks this SessionManager handles.voidload(com.google.android.exoplayer2.drm.DrmInitData videoInitData, com.google.android.exoplayer2.drm.DrmInitData audioInitData) Pass in video and audio init data and trigger a license load.voidonComponentError(DrmLicenseManagerComponent drmTimingComponent, Exception exception) Called when aDrmLicenseManagerComponenttriggers an errorvoidRemoves the license matching the provided offline ID.Methods inherited from interface com.google.android.exoplayer2.drm.DrmSessionManager
acquireSession, getCryptoType, preacquireSession, prepare, release, setPlayer
-
Method Details
-
getTrackType
Returns whichTrackRendererPlugin.Typeof Tracks this SessionManager handles.- Returns:
- the Type
-
load
void load(@Nullable com.google.android.exoplayer2.drm.DrmInitData videoInitData, @Nullable com.google.android.exoplayer2.drm.DrmInitData audioInitData) throws Exception Pass in video and audio init data and trigger a license load. Implementations of this method must operate in foreground- Parameters:
videoInitData- The video init dataaudioInitData- The audio init data- Throws:
Exception- in case an error is raised during the license request
-
fetchLicence
void fetchLicence(@NonNull com.google.android.exoplayer2.Format format, @Nullable DrmConfiguration drmConfiguration) Used for pre-fetching a DRM License. It should perform the license request but not "enabling" it.- Parameters:
format- Format holding DRM initialization data. All containedDrmInitData.SchemeDatas must contain non-nullDrmInitData.SchemeData.data.drmConfiguration- DRM configuration to use for the license fetch
-
remove
Removes the license matching the provided offline ID.Some DRM vendors, such as Widevine, require to perform a request to the DRM server in order to remove the internal key. This is why Internet connectivity may be required. Upon successful license removal, the license will also be removed from the
PlayerSDK.DEFAULT_KEY_STORE.In order to remove the license, it must exist in the
PlayerSDK.DEFAULT_KEY_STORE.- Parameters:
offlineId- The offline ID used for license storage- Throws:
Exception- in case an error is raised during the license removal
-
close
void close()Close all sessions -
onComponentError
void onComponentError(@NonNull DrmLicenseManagerComponent drmTimingComponent, @NonNull Exception exception) Called when aDrmLicenseManagerComponenttriggers an error- Parameters:
drmTimingComponent- component that is triggering this errorexception- exception thrown by the component
-