Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: improved text formatting and clarity

Events are registered with an event name, a callback function, and

optionally a

an optional priority. The higher the priority, the earlier the callback will be called.

 

Note

Please note that the following functions can be performed only after you have successfully undertaken the first steps (see

chapter

the "Getting started" chapter).


After you have connected to the player, you can register or remove the callback using the following functions

.

:

Register Callback Event:

panel
Code Block
bgColor#DCDCDCborderStylenone
languagetext
Player.registerEventListener(eventName,
callback, priority = 0)ParameterDescriptioneventName

Name of the event. Currently all known HTML5 media events are supported (for a list of all events, for example, see the following link: Media-Events)

priorityoptional

Remove Callback Event

 function(event) {...}, priority = 0);

Remove Callback Event:

Code Block
languagetext
PanelbgColor#DCDCDCborderStylenone
Player.unregisterEventListener(eventName, 
callback
functionName, priority = 0);
ParameterDescription
eventNameName of the event. Currently all known HTML5 media events are supported (for a list of all events, for example, see the following link: Media-Events). We also provide a couple of additional events (see the "Supported Events" chapter).
callback

A function that should be called when the event is triggered. This can be either the name of the function or the function definition itself. Set up the callback function to receive an event object, this may provide useful data specific to the type of event used.

Info

Note that if you intend to use "unregisterEventListener", the function must be externally defined (as opposed to an anonymous function as shown in the "registerEventListener" example above).

priorityAn optional argument that sets the priority of the event (defaults to 0). The higher the value, the earlier the callback will be called.