Component Video
- Source:
Parameters:
Name | Type | Description |
---|---|---|
$ |
jQuery | Instance of jQuery |
Returns:
List of Video component methods
- Type
- Object
Members
(static) api :Object.<Methods>
- Source:
This object stores all public api methods
Type:
- Object.<Methods>
Methods
(static) checkSize(video)
- Source:
Sets class name to video element depending
on video width size.
"video-small" - if videoWidth < 481 && videoWidth >= 321
"hide-controls" - if videoWidth < 321
Parameters:
Name | Type | Description |
---|---|---|
video |
jQuery.<Element> | Video element |
(static) init()
- Source:
Finds all Video components that are not yet initialized and in a loop for each of them
runs "initInstance" method.
If component has property "playlist installed" it calls
XA.component.playlist.init
(static) initInstance(component, prop)
- Source:
For each video component run
initVideo, checkSize
methods and add checkSize as a callback for
eventListener to window.resize
Parameters:
Name | Type | Description |
---|---|---|
component |
jQuery | Root DOM element of video component wrapped by jQuery |
prop |
Object | Properties set in data attribute of video component |
(static) initVideo(video, properties)
- Source:
Initializes video component and creates instance of
MediaElementPlayer that
handles all work with video player.
Parameters:
Name | Type | Description |
---|---|---|
video |
jQuery.<Element> | Video element |
properties |
Object | Video element properties |
Returns:
undefined;
(static) initVideoFromPlaylist(video, playlist)
- Source:
This method is called by
Playlist.replaceSource
and extends properties of video component.
Parameters:
Name | Type | Description |
---|---|---|
video |
jQuery | Root DOM element of video component wrapped by jQuery |
playlist |
Object | set by playlist component |