Type Definitions
ErrorStatus
In this API, an ErrorStatus is returned when a promise is rejected.
Properties
Name | Type | Description |
---|---|---|
code |
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 can be used to retrieve the system control interfaces.
Properties
Name | Type | Description |
---|---|---|
type |
'idal-system-ready' | The system ready 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 retrieve 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.
//
// It is however strongly advised to use the ID-AL JavaScript SDK which offers
// a better alternative to achieve the same result.
// What's more, the SDK provide facilities to retrieve remote control interfaces.
// Please have a look at IDAL.getControlInterfaces() and IDAL.getRemoteControlInterfaces()
// 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>