Methods
autoadvance(delay)
Sets up auto-advance on the playlist.
Parameters:
Name | Type | Description |
---|---|---|
delay |
Number | The number of seconds to wait before each auto-advance. |
- Source:
clearTracks(player)
Removes all remote text tracks from a player.
Parameters:
Name | Type | Description |
---|---|---|
player |
Player |
- Source:
contains(value) → {Boolean}
Checks if the playlist contains a value.
Parameters:
Name | Type | Description |
---|---|---|
value |
String | Object | Array |
- Source:
Returns:
- Type
- Boolean
currentItem(indexopt) → {Number}
Get or set the current item in the playlist.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
index |
Number |
<optional> |
If given as a valid value, plays the playlist item at that index. |
- Source:
Returns:
The current item index.
- Type
- Number
factory(player, initialListopt, initialIndexopt) → {function}
Factory function for creating new playlist implementation on the given player.
API summary:
playlist(['a', 'b', 'c']) // setter playlist() // getter playlist.currentItem() // getter, 0 playlist.currentItem(1) // setter, 1 playlist.next() // 'c' playlist.previous() // 'b' playlist.first() // 'a' playlist.last() // 'c' playlist.autoadvance(5) // 5 second delay playlist.autoadvance() // cancel autoadvance
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
player |
Player | ||
initialList |
Array |
<optional> |
If given, an initial list of sources with which to populate the playlist. |
initialIndex |
Number |
<optional> |
If given, the index of the item in the list that should be loaded first. If -1, no video is loaded. If omitted, The the first video is loaded. |
- Source:
Returns:
Returns the playlist function specific to the given player.
- Type
- function
first() → {Object|undefined}
Plays the first item in the playlist.
- Source:
Returns:
Returns undefined and has no side effects if the list is empty.
- Type
- Object | undefined
indexOf(value) → {Number}
Gets the index of a value in the playlist or -1 if not found.
Parameters:
Name | Type | Description |
---|---|---|
value |
String | Object | Array |
- Source:
Returns:
- Type
- Number
last() → {Object|undefined}
Plays the last item in the playlist.
- Source:
Returns:
Returns undefined and has no side effects if the list is empty.
- Type
- Object | undefined
next() → {Object|undefined}
Plays the next item in the playlist.
- Source:
Returns:
Returns undefined and has no side effects if on last item.
- Type
- Object | undefined
playItem(player, delay, item) → {Player}
Plays an item on a player's playlist.
Parameters:
Name | Type | Description |
---|---|---|
player |
Player | |
delay |
Number | The number of seconds to wait before each auto-advance. |
item |
Object | A source from the playlist. |
- Source:
Returns:
- Type
- Player
plugin(list)
The video.js playlist plugin. Invokes the playlist-maker to create a playlist function on the specific player.
Parameters:
Name | Type | Description |
---|---|---|
list |
Array |
previous() → {Object|undefined}
Plays the previous item in the playlist.
- Source:
Returns:
Returns undefined and has no side effects if on first item.
- Type
- Object | undefined
reset(player)
Resets the auto-advance behavior of a player.
Parameters:
Name | Type | Description |
---|---|---|
player |
Player |
- Source:
setup(player, delay)
Sets up auto-advance behavior on a player.
Parameters:
Name | Type | Description |
---|---|---|
player |
Player | |
delay |
Number | The number of seconds to wait before each auto-advance. |
- Source: