new Playlist(playlist, properties)
- Source:
This class is used by Playlist module
Parameters:
Name | Type | Description |
---|---|---|
playlist |
jQuery | Root DOM element of playlist component wrapped by jQuery |
properties |
Object | Properties set in data attribute |
Methods
createNewSources(source, videoContainer)
- Source:
Creates new source element, sets up it with type & src. Created element
append to Video container (take it from videoContainer parameter)
Parameters:
Name | Type | Description |
---|---|---|
source |
$OrderedList | takes from properties.sources[itemIndex].src - source of playlist element |
videoContainer |
$OrderedList | container where source should be added |
(static) attachEvents()
- Source:
Attaches events to playlist-section and navigation items
Fires:
(static) loadPlaylistVideo()
- Source:
Initializes videos under component. On call and on
change-video event
calls replaceSource
(static) replaceSource(itemIndex, loadFromEvent)
- Source:
Replaces source of each video element under play list component.
After replacing it re-initializes video component by calling
XA.component.video.initVideoFromPlaylist
Parameters:
Name | Type | Description |
---|---|---|
itemIndex |
number | position of active video in video list |
loadFromEvent |
boolean |
Events
change-video
- Source:
Properties:
Name | Type | Description |
---|---|---|
properties |
Object | Indicates whether playlist has back button |
Change video event fires when user clicks
a ".playlist-nav a" element.
Type:
- object