Dart is an all-purpose JavaScript video player.
- Run
npm install
to install dependencies. - You can customize the file name, output path and global variable name in package.json.
- Run
npm run build
to generate a compiled static asset in thelib
folder. - Import the asset file into your project.
- You can also run
npm run dev
to automate the build during development.
var video = dart.create({
controls: true,
container: {
id: 'example-video',
parent: document.getElementById('video'),
dimensions: {
width: 900,
height: 550
}
},
videos: [
{ source: 'https://example.link/video1.mp4' },
{ source: 'https://example.link/video2.mp4' },
]
});
video.init();
video.play();
Documentation for the player API is programmatically generated through JSDoc. Read it here. Update the docs by running npm run docs
.
Unit tests are implemented using Jest. Run npm run test
to launch the test suite.
Description | Status |
---|---|
Debug mode: monitor player events in real time. | ✅ |
Playlists: queue multiple video files to be played. | ✅ |
Custom themes: design your own controls UI | 🚧 |