This tutorial will help you use the events emitted by the video player.
Available events
HTML documents loaded by the embedded web browser can retrieve events concerning various aspects of the system:
- playback events:
- FileStartEvent: the playback of a media file has started.
- FileEndEvent: the playback of a media file is over.
- FolderEnterEvent: the playback of a folder has started.
- FolderLeaveEvent: the playback of a folder is over.
- audio events:
- VolumeChangeEvent: the volume has been changed.
- MuteChangeEvent: the audio has been (un)muted.
- input contact events:
- InputContactEvent: input contacts have been modified.
- printer events:
- PrinterStateEvent: the printer state has changed.
- JobStateEvent: a print job has changed.
Event registration
Like any other standard event ("click", "mouseover", "load"...), the above events shall be registered using window.addEventListener() as defined by the DOM Specification.
For example, if you want to be informed when the playback of a file starts or ends:
window.addEventListener('idal-player-event', function(e) {
switch (e.detail.type) {
'file-start':
// Do something with e.detail.filename
break;
'file-end':
// Do something with e.detail.filename
break;
}
});
You will find examples on how to use a particular event in its own documentation.