Global

Type Definitions

ErrorStatus

In this API, an ErrorStatus is returned when a promise is rejected.

Properties:
Name Type Description
error number

The error code.

message string

The human readable message corresponding to the error.

IdalControlInterfaces

Object containing all the system control interfaces.

Properties:
Name Type Description
printer Printer

The printer control interface.

player Player

The player control interface.

logger Logger

The file logger control interface.

contact Contact

The input and output contact control interface.

serial Serial

The serial port control interface.

Events

SystemReadyEvent

SystemReadyEvent must be used to retrieve the system control interfaces.

Properties:
Name Type Description
type 'idal-system-ready'

The custom event type.

detail IdalControlInterfaces

All the system control interfaces.

This event shall be registered using window.addEventListener() as defined by the DOM specification.

It is fired only once when the HTML page is loaded.
It is not received within iframes, so pages running in an <iframe> cannot take control of the player.
It is necessary to register this event within a <script> tag in the HTML page.

It is strongly advised to use IDAL.getControlInterfaces() to get the control interfaces instead of manually using this event.

Type:
Example

Retrieving the control interfaces with the 'idal-system-ready' event.

<script>
// This example demonstrate the use of the 'idal-system-ready' event
// to retrieve the video player control interfaces.
//
// You can however consider using the ID-AL JavaScript SDK which offers
// a better alternative to achieve the same result.
// Please have a look at IDAL.getControlInterfaces()

// Global variable holding the control interfaces
var ControlInterfaces;
window.addEventListener('idal-system-ready', function(e) {
     // Keep a reference on the desired system control interfaces.
     ControlInterfaces = e.detail;

     // You can now control the video playback
     ControlInterfaces.player.getAllFolders()
         .then(function(folders) {
             // Do something useful with the folders array...
         })
         .catch(function() {
             // ...
         });

     // Or other parts of the player using the methods of:
     //      - ControlInterfaces.serial
     //      - ControlInterfaces.logger
     //      - ControlInterfaces.printer
     //      - ControlInterfaces.contact
});
</script>