Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jgallen23/videojs-playLists
VideoJS playlists done right!
https://github.com/jgallen23/videojs-playLists
Last synced: 3 months ago
JSON representation
VideoJS playlists done right!
- Host: GitHub
- URL: https://github.com/jgallen23/videojs-playLists
- Owner: jgallen23
- License: mit
- Created: 2013-06-01T00:37:27.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-12-23T17:37:29.000Z (almost 8 years ago)
- Last Synced: 2024-07-10T06:35:03.363Z (4 months ago)
- Language: JavaScript
- Size: 42 KB
- Stars: 88
- Watchers: 14
- Forks: 72
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE
Awesome Lists containing this project
- starred-awesome - videojs-playLists - VideoJS playlists done right! (JavaScript)
README
#videojs-playlists
Sexy Playlists for VideoJS.
##Installation
###Bower
`bower install videojs-playlists`
###Manual Download
- [Development]()
- [Production]()##Usage
### Initialize playList
In order to initialize `playList` you need to pass an array of videos with this structure:
```js
videos = [
{
src : [
'http://stream.flowplayer.org/bauhaus/624x260.webm',
'http://stream.flowplayer.org/bauhaus/624x260.mp4',
'http://stream.flowplayer.org/bauhaus/624x260.ogv'
],
poster : '',
title : 'Whales'
},
{
src : [
'http://vjs.zencdn.net/v/oceans.mp4',
'http://vjs.zencdn.net/v/oceans.webm'
],
poster : 'http://www.videojs.com/img/poster.jpg',
title : 'Ocean'
}
];
```Now, when videos plays they automatically jump to the next one. You also gain a couple of methods
### Jump to video
Use `player.playList(index)` to jump to a video into the playlist.
### next
VideoJS receives a `next()` function which put in place the next video.
### prev
VideoJS receives a `prev()` function which put in place the previous video.
### Events
NameDescription
nextFired when you use the `next()` function or when one video finish and the next starts.
prevFired when you use the `prev()` function.
lastVideoEndedFired when the playlist has finished.A [demo](http://belelros.github.io/videojs-playLists/) is now available to showcase what you can create with this plugin.
##Pending
Pass video parameter to `next` and `prev` events. That should need to rewrite the trigger function from videojs since
doesn't allow passing events.As a workaround, the `player.pl.current` is updated with the actual index and `player.pl.currentVideo` contains the
video object.##Development
###Requirements
- node and npm
- bower `npm install -g bower`
- grunt `npm install -g grunt-cli`###Setup
- `npm install`
- `bower install`###Run
`grunt dev`
or for just running tests on file changes:
`grunt ci`
###Tests
`grunt mocha`