aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/blueimp/jquery-file-upload/js/jquery.fileupload-video.js
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-11-10 12:49:51 +0000
committerMario <mario@mariovavti.com>2019-11-10 14:10:03 +0100
commit580c3f4ffe9608d2beb56d418c68b3b112420e76 (patch)
tree82335d01179ac361d3f547a4b8e8c598d302e9f3 /vendor/blueimp/jquery-file-upload/js/jquery.fileupload-video.js
parentd22766f458a8539a40a57f3946459a9be1f21cd6 (diff)
downloadvolse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.tar.gz
volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.tar.bz2
volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.zip
another bulk of composer updates
(cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce)
Diffstat (limited to 'vendor/blueimp/jquery-file-upload/js/jquery.fileupload-video.js')
-rw-r--r--vendor/blueimp/jquery-file-upload/js/jquery.fileupload-video.js176
1 files changed, 82 insertions, 94 deletions
diff --git a/vendor/blueimp/jquery-file-upload/js/jquery.fileupload-video.js b/vendor/blueimp/jquery-file-upload/js/jquery.fileupload-video.js
index aedcec2ba..06d5f66cf 100644
--- a/vendor/blueimp/jquery-file-upload/js/jquery.fileupload-video.js
+++ b/vendor/blueimp/jquery-file-upload/js/jquery.fileupload-video.js
@@ -9,105 +9,93 @@
* https://opensource.org/licenses/MIT
*/
-/* jshint nomen:false */
-/* global define, require, window, document */
+/* global define, require */
-;(function (factory) {
- 'use strict';
- if (typeof define === 'function' && define.amd) {
- // Register as an anonymous AMD module:
- define([
- 'jquery',
- 'load-image',
- './jquery.fileupload-process'
- ], factory);
- } else if (typeof exports === 'object') {
- // Node/CommonJS:
- factory(
- require('jquery'),
- require('blueimp-load-image/js/load-image'),
- require('./jquery.fileupload-process')
- );
- } else {
- // Browser globals:
- factory(
- window.jQuery,
- window.loadImage
- );
- }
-}(function ($, loadImage) {
- 'use strict';
-
- // Prepend to the default processQueue:
- $.blueimp.fileupload.prototype.options.processQueue.unshift(
- {
- action: 'loadVideo',
- // Use the action as prefix for the "@" options:
- prefix: true,
- fileTypes: '@',
- maxFileSize: '@',
- disabled: '@disableVideoPreview'
- },
- {
- action: 'setVideo',
- name: '@videoPreviewName',
- disabled: '@disableVideoPreview'
- }
+(function(factory) {
+ 'use strict';
+ if (typeof define === 'function' && define.amd) {
+ // Register as an anonymous AMD module:
+ define(['jquery', 'load-image', './jquery.fileupload-process'], factory);
+ } else if (typeof exports === 'object') {
+ // Node/CommonJS:
+ factory(
+ require('jquery'),
+ require('blueimp-load-image/js/load-image'),
+ require('./jquery.fileupload-process')
);
+ } else {
+ // Browser globals:
+ factory(window.jQuery, window.loadImage);
+ }
+})(function($, loadImage) {
+ 'use strict';
- // The File Upload Video Preview plugin extends the fileupload widget
- // with video preview functionality:
- $.widget('blueimp.fileupload', $.blueimp.fileupload, {
-
- options: {
- // The regular expression for the types of video files to load,
- // matched against the file type:
- loadVideoFileTypes: /^video\/.*$/
- },
-
- _videoElement: document.createElement('video'),
-
- processActions: {
+ // Prepend to the default processQueue:
+ $.blueimp.fileupload.prototype.options.processQueue.unshift(
+ {
+ action: 'loadVideo',
+ // Use the action as prefix for the "@" options:
+ prefix: true,
+ fileTypes: '@',
+ maxFileSize: '@',
+ disabled: '@disableVideoPreview'
+ },
+ {
+ action: 'setVideo',
+ name: '@videoPreviewName',
+ disabled: '@disableVideoPreview'
+ }
+ );
- // Loads the video file given via data.files and data.index
- // as video element if the browser supports playing it.
- // Accepts the options fileTypes (regular expression)
- // and maxFileSize (integer) to limit the files to load:
- loadVideo: function (data, options) {
- if (options.disabled) {
- return data;
- }
- var file = data.files[data.index],
- url,
- video;
- if (this._videoElement.canPlayType &&
- this._videoElement.canPlayType(file.type) &&
- ($.type(options.maxFileSize) !== 'number' ||
- file.size <= options.maxFileSize) &&
- (!options.fileTypes ||
- options.fileTypes.test(file.type))) {
- url = loadImage.createObjectURL(file);
- if (url) {
- video = this._videoElement.cloneNode(false);
- video.src = url;
- video.controls = true;
- data.video = video;
- return data;
- }
- }
- return data;
- },
+ // The File Upload Video Preview plugin extends the fileupload widget
+ // with video preview functionality:
+ $.widget('blueimp.fileupload', $.blueimp.fileupload, {
+ options: {
+ // The regular expression for the types of video files to load,
+ // matched against the file type:
+ loadVideoFileTypes: /^video\/.*$/
+ },
- // Sets the video element as a property of the file object:
- setVideo: function (data, options) {
- if (data.video && !options.disabled) {
- data.files[data.index][options.name || 'preview'] = data.video;
- }
- return data;
- }
+ _videoElement: document.createElement('video'),
+ processActions: {
+ // Loads the video file given via data.files and data.index
+ // as video element if the browser supports playing it.
+ // Accepts the options fileTypes (regular expression)
+ // and maxFileSize (integer) to limit the files to load:
+ loadVideo: function(data, options) {
+ if (options.disabled) {
+ return data;
}
+ var file = data.files[data.index],
+ url,
+ video;
+ if (
+ this._videoElement.canPlayType &&
+ this._videoElement.canPlayType(file.type) &&
+ ($.type(options.maxFileSize) !== 'number' ||
+ file.size <= options.maxFileSize) &&
+ (!options.fileTypes || options.fileTypes.test(file.type))
+ ) {
+ url = loadImage.createObjectURL(file);
+ if (url) {
+ video = this._videoElement.cloneNode(false);
+ video.src = url;
+ video.controls = true;
+ data.video = video;
+ return data;
+ }
+ }
+ return data;
+ },
- });
-
-}));
+ // Sets the video element as a property of the file object:
+ setVideo: function(data, options) {
+ if (data.video && !options.disabled) {
+ data.files[data.index][options.name || 'preview'] = data.video;
+ }
+ return data;
+ }
+ }
+ });
+});