Custom playlist plugin for Ooyala player v4.
Source code of the plugin is located under the src
folder.
An example of the usage of the plugin is located under the example
folder.
The playlist plugin is configured by the following properties of the playerParam
object used to create the player:
boolean
If true, when a video finishes it is sent to the bottom of the playlist. Default is false.
boolean
If true, when the last video finishes playing the first video of the playlist is started next. Requires the autoplay
property set to true. Default is false.
boolean
If true, autoplays the next video in the playlist when a video is done. Default is false.
boolean
If true, the first video from the playlist is played when the player is loaded, instead of the original embed code. Default is false.
Configuration object which has the following properties:
array
An array of themebuilder playlists IDs. Must have at least one item.
string
DOM element ID of the div where the playlist should be rendered.
boolean
If true, the currently playing item is highlighted. Default true.
function
Function to call when the playlist finishes loading.
function
Function to call when an item gets clicked. Receives two parameters: item
and index
.
string
Color to use for highlighted items.
object
css classes to use for the playlist elements.
Default object is:
customCssClasses: {
'container': 'Playlist-assets',
'item': 'Playlist-asset animated fadeInUp',
'image': 'Playlist-asset-image',
'info': 'Playlist-asset-info',
'title': 'Playlist-header'
}
An example of a configuration setup is found under example/js/sample.js
example/index.html
Is a sample webpage that loads the player, along with it's dependencies, the playlist plugin and a custom javascript file example/js/sample.js
which configures the playlist plugin.
example/js/sample.js
is a script that configures and loads the Ooyala player and also configures the playlist plugin. This particular example includes two custom event listeners that subcsribe to the
playlist events:
onLoad: which hides the loading spinner that was added in example/index.html
onItemClick: which, when clicking on an item of the playlist, scrolls to the top of the page.
Create a new branch with your changes and submit a PR. We'll review it and get in contact.