2.0.1 • Published 1 month ago

videojs-vjsdownload v2.0.1

Weekly downloads
987
License
Apache-2.0
Repository
github
Last release
1 month ago

videojs-vjsdownload

Adds a button to download the video inside the player

Demo

https://7ds7.github.io/videojs-vjsdownload/

or

https://codepen.io/binaryunit/pen/BMpegv

Usage

Include the plugin files

  • videojs-vjsdownload.js
  • videojs-vjsdownload.css

also available trough bower install videojs-vjsdownload or 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 the play button icon rotated 90deg with some suggar on top, to include a custom icon please refer to videojs-vjsdownload.css file

2.0.1

1 month ago

2.0.0

1 month ago

1.0.5

8 months ago

1.0.4

5 years ago

1.0.3

6 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.0.0

8 years ago