new EntitlementEngine( [options])
EntitlementEngine 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:
EntitlementEngine
- 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
entitlementEngineEntitlementEngine The entitlement engine to register
Throws:
Error
Returns:
EntitlementEngine
- Type
- EntitlementEngine
-
fetchPreferences(callback)
-
Fetch user Preferences
Parameters:
Name Type Description callbackfunction -
getAssetInfo(assetId, callback)
-
Get the Asset Info
Parameters:
Name Type Description assetIdstring callbackfunction -
getCachedServerTime()
-
getCachedServerTime
Returns:
getCachedServerTime
- Type
- number
-
getChannelInfo(channelId, callback)
-
get ChannelInfo
Parameters:
Name Type Description channelIdstring Channel to fetch from
callbackfunction Callback when entitlement is fetched
-
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 fileParameters:
Name Type Description entitlementRequestEntitlementRequest Entitlement request to execute
playRequestObject Playrequest object containing information about the required
attributes of the entitlement (e.g. { drm: 'EDRM', 'format': 'HLS' }callbackfunction Callback when entitlement is fetched or an error occurs
-
getEPG(channelId, from, to, callback)
-
Get EPG
Parameters:
Name Type Description channelIdstring fromstring tostring callbackfunction -
getNextProgram(programId, callback)
-
Get next program
Parameters:
Name Type Description programIdstring callbackfunction -
getPreferences(callback)
-
Get user preferences key/value pair of (audioLang, subtitlesLang)
Parameters:
Name Type Description callbackEntitlementEngine~getPreferences Callback with user Preferences
-
getPreviousProgram(programId, callback)
-
Get previous program
Parameters:
Name Type Description programIdstring callbackfunction -
getProgramInfo(channelId, date, callback, programId)
-
Get the program based on EPG
Parameters:
Name Type Description channelIdstring dateDate callbackfunction programIdstring -
getServerTime(callback)
-
Returns the exact servertime
Parameters:
Name Type Description callbackEntitlementEngine~getServerTimeCallback Callback when server time is fetched or an error occurs
-
getV2Entitlement(entitlementRequest, playRequest, callback, preEntitlement)
-
Get Entitlement version 2
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 fileParameters:
Name Type Description entitlementRequestEntitlementRequest Entitlement request to execute
playRequestObject Playrequest object containing information about the required
attributes of the entitlement (e.g. { drm: 'EDRM', 'format': 'HLS' }callbackfunction Callback when entitlement is fetched or an error occurs
preEntitlementEntitlement Previous Entitlement after error
-
login(username, password, callback, mfacode)
-
Login
Parameters:
Name Type Description usernamestring passwordstring callbackfunction mfacodestring -
logout(callBack)
-
logout
Parameters:
Name Type Description callBackfunction -
savePreferences(preferences, callback)
-
Save user preferences (audioLang, subtitlesLang)
Parameters:
Name Type Description preferencesany key/value pair of (audioLang, subtitlesLang)
callbackfunction -
savePreferences(preferences, callback)
-
Save user preferences
Parameters:
Name Type Description preferencesObject callbackfunction -
syncServerTime(callback)
-
Sync localtime with servertime
Parameters:
Name Type Description callbackEntitlementEngine~getServerTimeCallback Callback when localtime sync with servertime or an error occurs
-
verifyEntitlement(assetId, playRequest, callback)
-
verify the entitlement
Parameters:
Name Type Description assetIdstring playRequestObject callbackfunction -
verifySession(okFn, nokFn)
-
Verifies if sessionToken is still valid
Parameters:
Name Type Description okFnfunction callback if session is ok
nokFnfunction callback if session is not ok
Type Definitions
-
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 2