Option name | Type | Description |
---|---|---|
selector | domelement_or_querystring_or_jqueryobject | The element that wraps the controls HTML |
options | object | Object containing the settings for the controls |
NATION.Utils
NATION.EventDispatcher
Either NATION.Animation or jQuery
Optional NATION.ProgressBar if a progress bar is required
Controls for use with audio and video players. Has support for play/pause button, mute button, progress bar, full screen button, current time display, duration display, and a play/pause area over a video
Each button is optional. The class will look for elements within selector and enable them if it finds them. Below are the classnames to use for each feature:
Event that fires when the play button has been clicked
Event that fires when the pause button has been clicked
Event that fires when the mute button has been clicked
Event that fires when the unmute button has been clicked
Event that fires when the progress bar has been clicked
Event that fires when the 'enter full screen' button has been clicked
Event that fires when the 'exit full screen' button has been clicked
Event that fires when the user has pressed down on the handle and is about to start dragging
Event that is fired each time the user moves their mouse horizontally while clicked down on the handle
Event that fires when the handle has been released by the user
Event that fires when the large play button over the video has been hidden (mobileMode only)
Option name | Type | Description |
---|---|---|
percentage | number | Percentage to set progress bar to, between 0 and 1 |
Set play progress percentage
Option name | Type | Description |
---|---|---|
timeString | string | This can be any string at all, which will be shown as the media duration |
Set the string shown in the .js-duration/.duration element (if one exists)
Option name | Type | Description |
---|---|---|
timeString | string | This can be any string at all, which will be shown as the media's current timestamp |
Set the string shown in the .js-current-time/.current-time element (if one exists)
Option name | Type | Description |
---|---|---|
percentage | number | Percentage between 0 and 1 |
adjustHitArea | boolean | Match clickable hitarea to loaded bar |
Set the percentage loaded
Returns the percentage the user wants to scan to, between 0 and 1
Returns whether controls are currently visible or not
Switches play button to 'not currently playing' state
Switches play button to 'currently playing' state
Show the controls
Hide the controls
Start the automatic hiding of controls after a period of idle mouse movement
Shows large play button that sits over the video
Hides the large play button. This means users can click directly on the YouTube video
Show the mute button (ie. the sound is currently on)
Show the unmute button (ie. the sound is currently off)