In order to add a video player on a page of your site, click on the "api.video player" item of the Visual elements list.
Then, draw the player on your page using your mouse, like you do we any other Visual component. Once done, double-click on the player to open the window for editing its properties.
You should see something like that:
As you can see there is a list of specific attribute that you can use to customize your player:
|videoid||yes||string||the id of the video (vod or live) to play. This value is dynamic. That means that you can get them from your database, or from another element (a list of videos for instance)|
|live||no (default: false)||boolean||indicate that the video is a live one|
|autoplay||no (default: false)||boolean||start playing the video as soon as it is loaded|
|muted||no (default: false)||boolean||the video is muted|
|hideControls||no (default: false)||boolean||the controls are hidden|
|hideTitle||no (default: false)||boolean||the video title is hidden|
|showSubtitles||no (default: false)||boolean||the video subtitles are shown by default|
|loop||no (default: false)||boolean||once the video is finished it automatically starts again|
Once you've entered a videoId, you can click on "preview" to see your player in action.
The video player element will trigger events during playback, so you will be able to perform some conditional actions like displaying a custom replay button when playback ends, or incrementing a views counter when playback starts.
Here is the list of all events triggered by the player:
|ended||The playback as reached the ended of the video|
|error||An error occured|
|firstplay||The video started to play for the first time|
|mouseenter||The user's mouse entered the player area|
|mouseleave||The user's mouse leaved the player area|
|pause||The video has been paused|
|play||The video started to play (for the first time or after having been paused)|
|ready||The player is ready to play|
|resize||The video size has changed|
|seeking||The player is seeking|
To perform an action when an event occurs, go to the workflow tab, create a new workflow, and as a trigger condition, select "Elements -> A api.video player ..." :
The player element has a single exposed state. This contains the "timeupdate" value, which corresponds to the time of the playback progress, in seconds. This value is sent several times per second and allow to follow precisely the progression of the playback.
The player exposes several action the can be triggered from a workflow. That makes it fully controllable.
Here is the list of available actions:
|play||Start playing the video|
|pause||Pause the video playback|
|mute||Mute the video|
|unmute||Unmute the video|
|hideControls||Hide the player controls|
|showControls||Show the player controls|
|hideSubtitles||Hide the player subtitles|
|showSubtitles||Show the player subtitles|
Updated 15 days ago