A callback is a function you can assign and our player calls that function when some event happens. So we call code that you can define yourself, making the system super flexible.
There are multiple player callbacks available in the new Privacy Player Pro
Easily one of the most useful of these callbacks is the
In this example the control bar is hidden when the player is ready, with this callback you can easily start your program the moment the player is ready, no need for risky timers of inefficient "while true" loops.
This callback will be called when the player starting
In this example whenever the player starts playing we enable the station logo.
25 is the percentage of the width, and 1 is the opacity.
This callback is the opposite of the previous callback, it is called when the player is paused.
In this example whenever the player is paused we disable the station logo.
This callback will sent you the current position of the player in the content.
When the volume of the player is changed this callback will be called
This callback will give you the metadata of the content
In previous versions of our player we had a system of messages posted to the parent window. This system is still intact, but it is advised to migrate to the callback system.
possible to transfer data from two different domains. Therefore some small steps are needed on in order to get the
meta data from the iFrame player to the main page where the player is embedded. This is done by using the
First of all, add the query string parameter
events=1 to the iFrame player url. This will enable the pass
through code for passing through the player events
The following events are available with data:
|durationchange||new duration in seconds|
|loadeddata||amount of buffer data in percentage|
|loadedmetadata||Object with duration, height, width, levels variables|
|progress||Object with start and end which holds the buffer start and end position|
|ratechange||the new playback rate|
|timeupdate||the new/current position in seconds|
|volumechange||the new/current volume|