Methods
ascending(previousSize, nextSize) → {Array}
Ascending sorting for breakpoints
Parameters:
Name | Type | Description |
---|---|---|
previousSize |
Array | Previous breakpoint to sort |
nextSize |
Array | Next breakpoint to sort |
Returns:
Breakpoints array sorted in ascending order
- Type
- Array
getActiveBreakpoints(playerSize, sizes) → {function}
Gets all active breakpoints that may be applied to current video player size.
Parameters:
Name | Type | Description |
---|---|---|
playerSize |
number | The player size. |
sizes |
Object | Object containing all possible breakpoints. |
Returns:
The active breakpoints.
- Type
- function
getMediaQueries(settings, defaults) → {Object}
Overwrites default breakpoints with ones specified by the developer.
Parameters:
Name | Type | Description |
---|---|---|
settings |
Object | Settings passed on initialisation. |
defaults |
Object | Default settings for plugin. |
Returns:
Settings to be applied.
- Type
- Object
getPlayerSize(player, sizes) → {String}
Gets the breakpoint name for the current player's size
Parameters:
Name | Type | Description |
---|---|---|
player |
Player | Video.js player object. |
sizes |
Object | Object containing all possible breakpoints. |
Returns:
Breakpoint name.
- Type
- String
isNative(player, control) → {boolean}
Determines if given control is a native Video.js plugin by searching for it in player.controlBar.
Parameters:
Name | Type | Description |
---|---|---|
player |
Player | Video.js player object. |
control |
String | Name of the plugin. |
Returns:
True if native, False otherwise.
- Type
- boolean
mergeUserSettings(settings, defaults) → {Object}
Uses deep-merge to merge default controls settings with ones specified by the developer.
Parameters:
Name | Type | Description |
---|---|---|
settings |
Object | Settings paased on initialisation. |
defaults |
Object | Default settings for plugin. |
Returns:
Settings to be applied.
- Type
- Object
newDetector() → {ElementResizeDetector}
Initializes new instance of resize detector
Returns:
Detector instance
- Type
- ElementResizeDetector
responsiveControls(optionsopt)
A video.js plugin.
In the plugin function, the value of this
is a video.js Player
instance. You cannot rely on the player being in a "ready" state here,
depending on how the plugin is invoked. This may or may not be important
to you; if not, remove the wait for "ready"!
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
Object |
<optional> |
{} | An object of options left to the plugin author to define. |
set(player, control, setting) → {function}
Applies specified settingf to the control element based on video player's size
Parameters:
Name | Type | Description |
---|---|---|
player |
Player | Video.js player object. |
control |
Object | String | Video.js plugin instance or class name. |
setting |
boolean | Indites if the control element should be visible on given breakpoint. |
Returns:
- Type
- function
setCustom(player, className, show) → {DOMElement|undefined}
Uses CSS to hide or show custom element. Useful for legacy plugins that do not follow official plugin structure.
Parameters:
Name | Type | Description |
---|---|---|
player |
Player | Video.js player object. |
className |
String | Class of the element to trigger. |
show |
boolean | Desired state. |
Returns:
- Type
- DOMElement | undefined
setNative(player, control, show) → {function}
Uses Video.js API to hide or show Video.js plugin.
Parameters:
Name | Type | Description |
---|---|---|
player |
Player | Video.js player object. |
control |
Object | The element to trigger. |
show |
boolean | Desired state. |
Returns:
- Type
- function
setup(player, arg2) → {undefined}
Applies specified settings to the video player based on it's size
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
player |
Player | Video.js player object. |
|||||||||
arg2 |
Object | Settings object Properties
|
Returns:
- Type
- undefined
trueByDefault(setting) → {boolean}
Controls should be visible by default so this function checks if desired state was specified and returns either desired state or true.
Parameters:
Name | Type | Description |
---|---|---|
setting |
boolean | Desired state. |
Returns:
Desired state or true.
- Type
- boolean