https://github.com/7ds7/videojs-vjsdownload
Adds a button to download the video inside a VideoJS player
https://github.com/7ds7/videojs-vjsdownload
download videojs videojs-player videojs-plugin
Last synced: 12 months ago
JSON representation
Adds a button to download the video inside a VideoJS player
- Host: GitHub
- URL: https://github.com/7ds7/videojs-vjsdownload
- Owner: 7Ds7
- License: other
- Created: 2016-02-01T17:35:17.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-03-23T00:11:17.000Z (about 2 years ago)
- Last Synced: 2025-06-21T06:07:21.193Z (12 months ago)
- Topics: download, videojs, videojs-player, videojs-plugin
- Language: JavaScript
- Homepage:
- Size: 55.7 KB
- Stars: 20
- Watchers: 3
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# videojs-vjsdownload
Adds a button to download the video inside the player
## Demo
https://7ds7.github.io/videojs-vjsdownload/demo
or
https://codepen.io/binaryunit/pen/xxedpwp
## Usage
Include the plugin files
* videojs-vjsdownload.js
* videojs-vjsdownload.css
also available trough ```npm install videojs-vjsdownload```
```
var player = videojs(document.querySelector('.video-js'), {
plugins: {
vjsdownload:{
beforeElement: 'playbackRateMenuButton',
textControl: 'Download video',
name: 'downloadButton',
downloadURL: 'https://video_url.mp4' //optional if you need a different download url than the source
}
}
} , function() {
console.log('Callback video-js initiated');
this.on('downloadvideo', function(){
console.log('downloadvideo triggered');
});
});
```
## Options
* beforeElement: name of the player.controlBar component for the button to be attached before (default: fullscreenMenuToggle)
* textControl: String for the controlText (default: 'Download Video')
* name: name of the DownloadButton component (default: 'downloadButton')
* downloadURL: oprional file to download (default: null)
## Style
By default the download icon is a clip path, to include a custom icon please refer to videojs-vjsdownload.css file