Handles playback of video. This is essentially a wrapper for the HTML5 video tag. It emulates all the same methods, properties and events; along with adding a few extra useful ones.

Methods

Video(di)

Item Value
Scope Constructor
Returns Video

Parameters

Parameter Description
Object di DI object

Initialise Video plugin. Creates the video object.


Properties

buffered

Item Value
Scope public
Returns TimeRange

How much of the video has been buffered


currentTime

Item Value
Scope public
Returns Number

The timecode of the loaded video in seconds


el

Item Value
Scope public
Returns VideoElement

Returns the video element associated with this instance


duration

Item Value
Scope public
Returns Number

Get the video duration in seconds


volume

Item Value
Scope public
Returns Number

Get the video volume level. Will return a Number between 0 and 1


played

Item Value
Scope public
Returns TimeRange

How much of the video has been played


paused

Item Value
Scope public
Returns Boolean

Is the video currently paused

ended

Item Value
Scope public
Returns Boolean

Has the video finished playing all the way through


seeking

Item Value
Scope public
Returns Boolean

Is the video currently seeking


live

Item Value
Scope public
Returns Boolean

Is the video a live stream


Events

Every HTML5 Media Event as documented here

videoPluginInitialised

Fired on plugin being initialised


videoPluginReady

Fired on plugin being ready to interact with


scheduleEnded

Fired on schedule ending


loadstart

Fires when the browser starts looking for the video


progress

Fires when the browser is downloading the video


suspend

Fires when the browser is intentionally not getting media data


abort

Fires when the loading of a video is aborted


error

Fires when an error occurred during the loading of a video


emptied

Fires when the current video is empty


stalled

Fires when the browser is trying to get media data, but data is not available


loadedmetadata

Fires when the browser has loaded meta data for the video


loadeddata

Fires when the browser has loaded the current frame of the video


canplay

Fires when the browser can start playing the video


canplaythrough

Fires when the browser can play through the video without stopping for buffering


playing

Fires when the video is ready to play after having been paused or stopped for buffering


waiting

Fires when the video stops because it needs to buffer the next frame


seeking

Fires when the user starts moving/skipping to a new position in the video


seeked

Fires when the user is finished moving/skipping to a new position in the video


ended

Fires when the current video is ended


durationchange

The duration attribute has just been updated.


timeupdate

Fires when the current playback position has changed


play

Fires when the video has been started or is no longer paused


pause

Fires when the video has been paused


ratechange

Fires when the playing speed of the video is changed


resize

Fired when one or both of the videoWidth and videoHeight attributes have just been updated.


volumechange

Fires when the volume has been changed


Listeners

loadVideo

Parameters

Parameter Description
String url A url to play

Loads a video url, this can be in mp4 or hls format

{
    url: '//media.buto.tv/myvideo.mp4'
}

playVideo

Plays the current video


pauseVideo

Pauses the current video


stopVideo

Stops the current video, completely unloading it.


seekVideo

Parameters

Parameter Description
Number timecode A timecode to seek to

Seeks the video to a timecode in seconds

{
    timecode: 10
}

setVideoVolume

Parameters

Parameter Description
Number level The volume level as a decimal between 0 and 1

Sets the volume level must be a Number between 0 and 1

{
    level: 0.8
}

toggleFullscreen

Toggles the video's fullscreen status