IDALClient

IDALClient

Low level video player HTTP client.

This class is part of the ID-AL JavaScript SDK version 1.1.0.
It can be used to control a video player without using the IdalControlInterfaces API.

For more information about the HTTP API, please refer to the reference guide.

It is mandatory to update the video player to version v1.08 to use this to use this class.

Methods

addListener(type, listener): Promise.<boolean>

Attach an event handler.

Parameters
Name Type Description
type string

Event type ('idal-player-event', 'idal-contact-event'...).

listener Listener

Function to run when an event occurs.

Returns

A promise resolved with a boolean value.

Type
Promise.<boolean>

delete(path): Promise.<ApiResponse>

Send a DELETE request to the video player HTTP API.

Parameters
Name Type Description
path string

Path of the API to execute.

Returns

A promise resolved or rejected with an ApiResponse

Type
Promise.<ApiResponse>

get(path): Promise.<ApiResponse>

Send a GET request to the video player HTTP API.

Parameters
Name Type Description
path string

Path of the API to execute.

Returns

A promise resolved or rejected with an ApiResponse

Type
Promise.<ApiResponse>

post(path, data): Promise.<ApiResponse>

Send a POST request to the video player HTTP API.

The request may contain user defined data which are then set in the data field of the request.

Parameters
Name Type Description
path string

Path of the API to execute.

data *

Data to set on the request data field.

Returns

A promise resolved or rejected with an ApiResponse

Type
Promise.<ApiResponse>

removeListener(type, listener): Promise.<boolean>

Remove a registered event listener.

Parameters
Name Type Description
type string

Event type.

listener Listener

Function previously attached with addListener().

Returns

A promise resolved with a boolean value.

Type
Promise.<boolean>

Type Definitions

ApiError

Error reasons.

Properties
Name Type Description
code number

Error code (HTTP status).

appcode string

Application error code.

message string

Human readable message.

ApiResponse

Response to a call to the HTTP API of a video player.

Properties
Name Type Attributes Description
data * <optional>

On success, the response data.

errors Array.<ApiError> <optional>

On error, the error reasons.

Listener(event): void

Event handler callback function.

A Listener can be passed to IDALClient.addListener() and IDALClient.removeListener() to manage the video player state changes.

Parameters
Name Type Description
event external:CustomEvent

Event that occurred.

Returns
Type
void