Methods and events are available from skins, plugins and externally from IFrame API.
To use methods just call them as regular methods of player
object: player.play();
reload
- reloads video with another ID. Pass it to the parameter.
getData
- gets video metadata. Use parameter as a key of metadata. Some of possible metadata keys arename
,duration
.getState
- gets current video playback state. States may beplay
,pause
or other.
play
- starts video playback. Works everytime even if video is paused or stopped.pause
- pauses video playback.stop
- stops video playback.position
- rewind current video position to second passed as argument
hideSkin
- hides the skinshowSkin
- shows the skin back again after hiding
getWidth
andgetHeight
- returns player dimensions as they seen in pixelsgetVideoWidth
andgetVideoHeight
- returns video dimensions as they streamedgetDisplayVideoWidth
andgetDisplayVideoHeight
- returns video dimensions as they seen on display
volume
- sets volume. Pass float 0..1 as parametermute
- mutes soundunmute
- unmutes sound
To use events just use on
subscription similar to JQuery. First parameter will be the event name and the second will be optional parameter depending on event type.
start
- player is fully initialized and ready to workreload
- when player reloads video with another
play
- triggered when player is about to start playing content. It may happen when user clicks on play button.playing
- triggered just after the main video is started to play. The difference here withplay
event is this method ensures that player started to play video and not advertisement/other possible media.pause
- when user pauses the video playbackstop
- when video playback is stopped (fully played or externally called by API)timeupdate
- fired frequently during video playback. Passed parameter is current position in millisecondsseek
- when user performs seek on a video. Passed parameter is a millisecond to seek for.loaded_position
- buffered length event in milliseconds of last loaded moment. Triggered frequently during buffering process.
resize
- when size of player possibly changed.fullscreen
- when player comes to fullscreen or from fullscreen. Passes boolean parameter, true indicates that fullscreen is enabled
advertisement_state
- when player starts, finishes advertisement or in any other significant advertisement events provided by Ad plugin. Will never be triggered if no Ad plugin enabled (no advertisement)