项目作者: neuron-digital

项目描述 :
Adds a download button to control bar
高级语言: JavaScript
项目地址: git://github.com/neuron-digital/videojs-download-button.git
创建时间: 2016-07-18T11:44:38Z
项目社区:https://github.com/neuron-digital/videojs-download-button

开源协议:MIT License

下载


videojs-download-button

Adds a download button to control bar

Installation

  1. npm install --save videojs-download-button

The npm installation is preferred, but Bower works, too.

  1. bower install --save videojs-download-button

Usage

To include videojs-download-button on your website or web application, use any of the following methods.

<script> Tag

This is the simplest case. Get the script in whatever way you prefer and include the plugin after you include video.js, so that the videojs global is available.

  1. <script src="//path/to/video.min.js"></script>
  2. <script src="//path/to/videojs-download-button.min.js"></script>
  3. <script>
  4. var player = videojs('my-video');
  5. player.downloadButton();
  6. </script>

Browserify

When using with Browserify, install videojs-download-button via npm and require the plugin as you would any other module.

  1. var videojs = require('video.js');
  2. // The actual plugin function is exported by this module, but it is also
  3. // attached to the `Player.prototype`; so, there is no need to assign it
  4. // to a variable.
  5. require('videojs-download-button');
  6. var player = videojs('my-video');
  7. player.downloadButton();

RequireJS/AMD

When using with RequireJS (or another AMD library), get the script in whatever way you prefer and require the plugin as you normally would:

  1. require(['video.js', 'videojs-download-button'], function(videojs) {
  2. var player = videojs('my-video');
  3. player.downloadButton();
  4. });

License

MIT. Copyright (c) Mikhail Khazov mikhail.khazov@gmail.com