new EntitlementEngine( [options])
EntitlementEngine Base Class
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
options |
Object |
<optional> |
Object of option names and values |
Methods
-
<static> getEntitlementEngine(name)
-
Get an entitlement engine by name
Parameters:
Name Type Description nameString Name of the entitlement engine
Returns:
- Type
- EntitlementEngine
-
<static> isEntitlementEngine(object)
-
Return whether the past argument is an entitlement engine or not
Parameters:
Name Type Description objectObject An item to check
Returns:
Wheter it is a entitlement engine or not
- Type
- Boolean
-
<static> registerEntitlementEngine(name, entitlementEngine)
-
Register an entitlement engine
Parameters:
Name Type Description nameString Name of the entitlement engine
entitlementEngineThe entitlement engine to register
Throws:
Error
-
getEntitlement(entitlementRequest, playRequest, callback)
-
Get Entitlement
Called by the player to get an entitlement. Entitlement requests contain an assetId and an optional programId.
If the programId exists, the assetId is the channelId. if the programId doesn't exist the assetId is the assetId.The callback should be called when the requests completes, if it fails it should contain an EntitlementError
Exception object as it's second parameter.if it succeeds it should return the Entitlement as the first parameter.
The Entitlement should contain the following parameters:
playToken - Playtoken required for drm
mediaLocator - URL of playlist file (for example for dash or hls playback) or mediaId for flash playback.Parameters:
Name Type Description entitlementRequestEntitlementRequest Entitlement request to execute
playRequestObject Playrequest object containing information about the required
attributes of the entitlementcallbackEntitlementEngine~getEntitlementCallback Callback when entitlement is fetched or an error occurs
Throws:
-
getProgramInfo(channelId, date, callback)
-
Get the program based on EPG
Parameters:
Name Type Description channelIddatecallback -
getServerTime(callback)
-
Returns the exact servertime
Parameters:
Name Type Description callbackEntitlementEngine~getServerTimeCallback Callback when server time is fetched or an error occurs
Type Definitions
-
getEntitlementCallback(entitlement)
-
This callback is called whenever a new Entitlement object is fetched from the backend
Parameters:
Name Type Description entitlementEntitlement Entitlement object
-
getServerTimeCallback(date, error)
-
This callback is called by getServerTime when current time is fetched from the server or an error occured
Parameters:
Name Type Description dateDate Current server time
errorstring Error description
EMP Html5 Player