Package com.castlabs.sdk.drm
Class DrmDeviceTimeCheckerPlugin
- java.lang.Object
-
- com.castlabs.android.Plugin
-
- com.castlabs.sdk.drm.DrmDeviceTimeCheckerPlugin
-
public class DrmDeviceTimeCheckerPlugin extends Plugin
This plugin will perform periodic checks related to DRM licensing. In order to workaround a Widevine limitation this plugin performs some time-related checks while playing protected content. The limitation lies in changing the local device time in order to trick the DRM Content Decryption Module (CDM). If the license is expired, the plugin will stop playback and throw a fatal exception (CastlabsPlayerException.SEVERITY_ERROR) of typeCastlabsPlayerException.TYPE_KEY_EXPIRED. Before you can use this plugin, you need to register it with thePlayerSDKbefore you initialize the SDK itself. For example:
Optionally, you can specify the time period at which he license checks should be performed. Default value is every 5 minutes (PlayerSDK.register(new DrmDeviceTimeCheckerPlugin()); // ... PlayerSDK.init(getApplicationContext());DEFAULT_CHECK_INTERVAL_SEC).
This plugin needs two extra Android permissions. These permissions allow to internally keep track of license times. These permissions are automatically added to your AndroidManifest file once you include this plugin in your build file. This plugin provides a first line of defense against this practice, and it should be noted that this is not a bulletproof solution, since such thing could only be done by the CDM. Note that this plugin will only perform license checks taking into account the License's absolute expiration date, and not the play duration field.// ... PlayerSDK.register(new DrmDeviceTimeCheckerPlugin(60)); // Check every minute // ...- Since:
- 4.2.0
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_CHECK_INTERVAL_SECDefault value for the time in between checks
-
Constructor Summary
Constructors Constructor Description DrmDeviceTimeCheckerPlugin()Same as callingDrmDeviceTimeCheckerPlugin(int)withDEFAULT_CHECK_INTERVAL_SECDrmDeviceTimeCheckerPlugin(int checkIntervalSec)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetId()voidinit(Context context)-
Methods inherited from class com.castlabs.android.Plugin
onRemotePlay
-
-
-
-
Field Detail
-
DEFAULT_CHECK_INTERVAL_SEC
public static final int DEFAULT_CHECK_INTERVAL_SEC
Default value for the time in between checks- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DrmDeviceTimeCheckerPlugin
public DrmDeviceTimeCheckerPlugin()
Same as callingDrmDeviceTimeCheckerPlugin(int)withDEFAULT_CHECK_INTERVAL_SEC
-
DrmDeviceTimeCheckerPlugin
public DrmDeviceTimeCheckerPlugin(int checkIntervalSec)
- Parameters:
checkIntervalSec- How often will the check be performed
-
-