JavaScript Events

Binding to JavaScript events allows you to react when player performs certain actions. An example of how to bind events will help you determine when they occur.

Browser Compatibility

Event Name IE8 IE9 Chrome FireFox Safari Mobile Safari Blackberry
mediaTimeUpdate Flash Windows Media Player Flash Windows Media Player HTML5 Flash Quicktime HTML5 Flash Quicktime HTML5 Flash Quicktime HTML5 HTML5 Flash HTML5
mediaResumed Flash HTML5 Flash HTML5 Flash HTML5 Flash HTML5 Flash HTML5 HTML5 Flash HTML5
mediaPaused Flash Windows Media Player Flash Windows Media Player HTML5 Flash Quicktime HTML5 Flash Quicktime HTML5 Flash Quicktime HTML5 HTML5 Flash HTML5
mediaWaiting Flash Windows Media Player Flash Windows Media Player HTML5 Flash Quicktime HTML5 Flash Quicktime HTML5 Flash Quicktime HTML5 HTML5 Flash HTML5
mediaPlaying Flash Windows Media Player Flash Windows Media Player HTML5 Flash Quicktime HTML5 Flash Quicktime HTML5 Flash Quicktime HTML5 HTML5 Flash HTML5
mediaEnded Flash Windows Media Player Flash Windows Media Player HTML5 Flash Quicktime HTML5 Flash Quicktime HTML5 Flash Quicktime HTML5 HTML5 Flash HTML5
mediaError Flash Flash HTML5 Flash Quicktime HTML5 Flash Quicktime HTML5 Flash Quicktime HTML5 HTML5 Flash HTML5
mediaLoadStart Flash Windows Media Player Flash Windows Media Player HTML5 Flash Quicktime HTML5 Flash Quicktime HTML5 Flash Quicktime HTML5 HTML5 Flash HTML5

mediaTimeUpdate

Vio.Event.Bind(target, "mediaTimeUpdate", function (evt) {
    console.log(evt.value.currentTime);
    console.log(evt.value.duration);
}, null);

Triggered when the player changes it's current playback position.

mediaResumed

Vio.Event.Bind(target, "mediaResumed", function (evt) {
    console.log(evt.value)
}, null);

Triggered when a request is made for the player to play media.

mediaPaused

Vio.Event.Bind(target, "mediaPaused", function (evt) {
    console.log(evt.value)
}, null);

Triggered when player is no longer paused. This event is fired after a request to play the media has returned, or if the player is set to auto play media.

mediaWaiting

Vio.Event.Bind(target, "mediaWaiting", function (evt) {
    console.log(evt.value)
}, null);

Triggered when the player is waiting for media data.

mediaPlaying

Vio.Event.Bind(target, "mediaPlaying", function (evt) {
    console.log(evt.value)
}, null);

Triggered when the player has enough data to to begin playback.

mediaEnded

Vio.Event.Bind(target, "mediaEnded", function (evt) {
    console.log(evt.value)
}, null);

Triggered when the player has reached the end of the media file.

mediaError

Vio.Event.Bind(target, "mediaError", function (evt) {
    console.log(evt.value)
}, null);

Triggered when the player encounters and error whilst playing the media file.

mediaLoadStart

Vio.Event.Bind(target, "mediaLoadStart", function (evt) {
    console.log(evt.value)
}, null);

Triggered when the player begins loading the media metadata.