Class: EntitlementEngine

EntitlementEngine


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
name String

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
object Object

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
name String

Name of the entitlement engine

entitlementEngine

The 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
entitlementRequest EntitlementRequest

Entitlement request to execute

playRequest Object

Playrequest object containing information about the required
attributes of the entitlement

callback EntitlementEngine~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
channelId
date
callback

getServerTime(callback)

Returns the exact servertime

Parameters:
Name Type Description
callback EntitlementEngine~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
entitlement Entitlement

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
date Date

Current server time

error string

Error description