videojs-vjsdownload
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -9,6 +9,8 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
var doccy; | ||
if (typeof document !== 'undefined') { | ||
module.exports = document; | ||
doccy = document; | ||
} else { | ||
var doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4']; | ||
doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4']; | ||
@@ -18,6 +20,6 @@ if (!doccy) { | ||
} | ||
module.exports = doccy; | ||
} | ||
module.exports = doccy; | ||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | ||
@@ -50,3 +52,4 @@ },{"min-document":1}],3:[function(require,module,exports){ | ||
textControl: 'Download video', | ||
name: 'downloadButton' | ||
name: 'downloadButton', | ||
downloadURL: null | ||
}; | ||
@@ -100,3 +103,3 @@ | ||
window.open(p.currentSrc(), 'Download'); | ||
window.open(this.options_.downloadURL || p.currentSrc(), 'Download'); | ||
p.trigger('downloadvideo'); | ||
@@ -103,0 +106,0 @@ } |
/** | ||
* videojs-vjsdownload | ||
* @version 1.0.3 | ||
* @copyright 2018 7Ds7 | ||
* @version 1.0.4 | ||
* @copyright 2019 7Ds7 | ||
* @license Apache-2.0 | ||
@@ -33,3 +33,4 @@ */ | ||
textControl: 'Download video', | ||
name: 'downloadButton' | ||
name: 'downloadButton', | ||
downloadURL: null | ||
}; | ||
@@ -83,3 +84,3 @@ | ||
window.open(p.currentSrc(), 'Download'); | ||
window.open(this.options_.downloadURL || p.currentSrc(), 'Download'); | ||
p.trigger('downloadvideo'); | ||
@@ -86,0 +87,0 @@ } |
/** | ||
* videojs-vjsdownload | ||
* @version 1.0.3 | ||
* @copyright 2018 7Ds7 | ||
* @version 1.0.4 | ||
* @copyright 2019 7Ds7 | ||
* @license Apache-2.0 | ||
*/ | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.videojsVjsdownload=e()}}(function(){return function e(t,o,n){function r(l,u){if(!o[l]){if(!t[l]){var f="function"==typeof require&&require;if(!u&&f)return f(l,!0);if(i)return i(l,!0);var a=new Error("Cannot find module '"+l+"'");throw a.code="MODULE_NOT_FOUND",a}var d=o[l]={exports:{}};t[l][0].call(d.exports,function(e){var o=t[l][1][e];return r(o||e)},d,d.exports,e,t,o,n)}return o[l].exports}for(var i="function"==typeof require&&require,l=0;l<n.length;l++)r(n[l]);return r}({1:[function(e,t,o){(function(e){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(o,"__esModule",{value:!0});var i=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),l=function(e,t,o){for(var n=!0;n;){var r=e,i=t,l=o;n=!1,null===r&&(r=Function.prototype);var u=Object.getOwnPropertyDescriptor(r,i);if(void 0!==u){if("value"in u)return u.value;var f=u.get;if(void 0===f)return;return f.call(l)}var a=Object.getPrototypeOf(r);if(null===a)return;e=a,t=i,o=l,n=!0,u=a=void 0}},u="undefined"!=typeof window?window.videojs:void 0!==e?e.videojs:null,f=function(e){return e&&e.__esModule?e:{default:e}}(u),a={beforeElement:"fullscreenToggle",textControl:"Download video",name:"downloadButton"},d=f.default.getComponent("Button"),c=function(e){function t(){n(this,t),l(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return r(t,e),i(t,[{key:"buildCSSClass",value:function(){return"vjs-vjsdownload "+l(Object.getPrototypeOf(t.prototype),"buildCSSClass",this).call(this)}},{key:"handleClick",value:function(){var e=this.player();window.open(e.currentSrc(),"Download"),e.trigger("downloadvideo")}}]),t}(d),s=function(e,t){var o=e.controlBar.addChild(new c(e,t),{});o.controlText(t.textControl),e.controlBar.el().insertBefore(o.el(),e.controlBar.getChild(t.beforeElement).el()),e.addClass("vjs-vjsdownload")},p=function(e){var t=this;this.ready(function(){s(t,f.default.mergeOptions(a,e))})};f.default.registerPlugin("vjsdownload",p),o.default=p,t.exports=o.default}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.videojsVjsdownload=e()}}(function(){return function e(t,o,n){function r(l,u){if(!o[l]){if(!t[l]){var f="function"==typeof require&&require;if(!u&&f)return f(l,!0);if(i)return i(l,!0);var a=new Error("Cannot find module '"+l+"'");throw a.code="MODULE_NOT_FOUND",a}var d=o[l]={exports:{}};t[l][0].call(d.exports,function(e){var o=t[l][1][e];return r(o||e)},d,d.exports,e,t,o,n)}return o[l].exports}for(var i="function"==typeof require&&require,l=0;l<n.length;l++)r(n[l]);return r}({1:[function(e,t,o){(function(e){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(o,"__esModule",{value:!0});var i=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),l=function(e,t,o){for(var n=!0;n;){var r=e,i=t,l=o;n=!1,null===r&&(r=Function.prototype);var u=Object.getOwnPropertyDescriptor(r,i);if(void 0!==u){if("value"in u)return u.value;var f=u.get;if(void 0===f)return;return f.call(l)}var a=Object.getPrototypeOf(r);if(null===a)return;e=a,t=i,o=l,n=!0,u=a=void 0}},u="undefined"!=typeof window?window.videojs:void 0!==e?e.videojs:null,f=function(e){return e&&e.__esModule?e:{default:e}}(u),a={beforeElement:"fullscreenToggle",textControl:"Download video",name:"downloadButton",downloadURL:null},d=f.default.getComponent("Button"),c=function(e){function t(){n(this,t),l(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return r(t,e),i(t,[{key:"buildCSSClass",value:function(){return"vjs-vjsdownload "+l(Object.getPrototypeOf(t.prototype),"buildCSSClass",this).call(this)}},{key:"handleClick",value:function(){var e=this.player();window.open(this.options_.downloadURL||e.currentSrc(),"Download"),e.trigger("downloadvideo")}}]),t}(d),s=function(e,t){var o=e.controlBar.addChild(new c(e,t),{});o.controlText(t.textControl),e.controlBar.el().insertBefore(o.el(),e.controlBar.getChild(t.beforeElement).el()),e.addClass("vjs-vjsdownload")},p=function(e){var t=this;this.ready(function(){s(t,f.default.mergeOptions(a,e))})};f.default.registerPlugin("vjsdownload",p),o.default=p,t.exports=o.default}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}); |
@@ -25,3 +25,4 @@ 'use strict'; | ||
textControl: 'Download video', | ||
name: 'downloadButton' | ||
name: 'downloadButton', | ||
downloadURL: null | ||
}; | ||
@@ -75,3 +76,3 @@ | ||
window.open(p.currentSrc(), 'Download'); | ||
window.open(this.options_.downloadURL || p.currentSrc(), 'Download'); | ||
p.trigger('downloadvideo'); | ||
@@ -78,0 +79,0 @@ } |
{ | ||
"name": "videojs-vjsdownload", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "downloads video", | ||
@@ -85,3 +85,3 @@ "main": "es5/plugin.js", | ||
"dependencies": { | ||
"video.js": "^6.7.4" | ||
"video.js": "^7.4.1" | ||
}, | ||
@@ -88,0 +88,0 @@ "devDependencies": { |
@@ -5,2 +5,10 @@ # videojs-vjsdownload | ||
## Demo | ||
https://7ds7.github.io/videojs-vjsdownload/ | ||
or | ||
https://codepen.io/binaryunit/pen/BMpegv | ||
## Usage | ||
@@ -21,3 +29,4 @@ Include the plugin files | ||
textControl: 'Download video', | ||
name: 'downloadButton' | ||
name: 'downloadButton', | ||
downloadURL: 'https://video_url.mp4' //optional if you need a different download url than the source | ||
} | ||
@@ -24,0 +33,0 @@ } |
@@ -7,3 +7,4 @@ import videojs from 'video.js'; | ||
textControl: 'Download video', | ||
name: 'downloadButton' | ||
name: 'downloadButton', | ||
downloadURL: null | ||
}; | ||
@@ -33,3 +34,3 @@ | ||
window.open(p.currentSrc(), 'Download'); | ||
window.open(this.options_.downloadURL || p.currentSrc(), 'Download'); | ||
p.trigger('downloadvideo'); | ||
@@ -36,0 +37,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
41491
644
50
+ Added@babel/runtime@7.26.0(transitive)
+ Added@videojs/http-streaming@2.16.3(transitive)
+ Added@videojs/vhs-utils@3.0.5(transitive)
+ Added@videojs/xhr@2.6.0(transitive)
+ Added@xmldom/xmldom@0.8.10(transitive)
+ Addedaes-decrypter@3.1.3(transitive)
+ Addedglobal@4.4.0(transitive)
+ Addedkeycode@2.2.1(transitive)
+ Addedm3u8-parser@4.8.0(transitive)
+ Addedmpd-parser@0.22.1(transitive)
+ Addedmux.js@6.0.1(transitive)
+ Addedpkcs7@1.0.4(transitive)
+ Addedprocess@0.11.10(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
+ Addedurl-toolkit@2.2.5(transitive)
+ Addedvideo.js@7.21.6(transitive)
+ Addedvideojs-font@3.2.0(transitive)
+ Addedvideojs-vtt.js@0.15.5(transitive)
- Removedbabel-runtime@6.26.0(transitive)
- Removedcore-js@2.6.12(transitive)
- Removedes5-shim@4.6.7(transitive)
- Removedglobal@4.3.2(transitive)
- Removedparse-headers@2.0.5(transitive)
- Removedprocess@0.5.2(transitive)
- Removedregenerator-runtime@0.11.1(transitive)
- Removedtsml@1.0.1(transitive)
- Removedvideo.js@6.13.0(transitive)
- Removedvideojs-font@2.1.0(transitive)
- Removedvideojs-ie8@1.1.2(transitive)
- Removedvideojs-vtt.js@0.12.6(transitive)
- Removedxhr@2.4.0(transitive)
- Removedxtend@4.0.2(transitive)
Updatedvideo.js@^7.4.1