From e6e1427c4825f44f96ebffa2020f3edf04eeda5e Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 30 Mar 2015 19:03:26 +0200 Subject: [PATCH] added missing videojs.zoomrotate.js file added missing videojs.zoomrotate.js file --- web/js/videojs.zoomrotate.js | 72 ++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 web/js/videojs.zoomrotate.js diff --git a/web/js/videojs.zoomrotate.js b/web/js/videojs.zoomrotate.js new file mode 100644 index 000000000..5d906014b --- /dev/null +++ b/web/js/videojs.zoomrotate.js @@ -0,0 +1,72 @@ +console.log('zoomrotate: Start'); + +(function(){ + var defaults, extend; + console.log('zoomrotate: Init defaults'); + defaults = { + zoom: 1, + rotate: 0 + }; + console.log('zoomrotate: Init Extend'); + extend = function() { + var args, target, i, object, property; + args = Array.prototype.slice.call(arguments); + target = args.shift() || {}; + for (i in args) { + object = args[i]; + for (property in object) { + if (object.hasOwnProperty(property)) { + if (typeof object[property] === 'object') { + target[property] = extend(target[property], object[property]); + } else { + target[property] = object[property]; + } + } + } + } + return target; + }; + + /** + * register the zoomrotate plugin + */ + videojs.plugin('zoomrotate', function(options){ + console.log('zoomrotate: Register init'); + var settings, player, video, poster; + settings = extend(defaults, options); + + /* Grab the necessary DOM elements */ + player = this.el(); + video = this.el().getElementsByTagName('video')[0]; + poster = this.el().getElementsByTagName('div')[1]; // div vjs-poster + + console.log('zoomrotate: '+video.style); + console.log('zoomrotate: '+poster.style); + console.log('zoomrotate: '+options.rotate); + console.log('zoomrotate: '+options.zoom); + + /* Array of possible browser specific settings for transformation */ + var properties = ['transform', 'WebkitTransform', 'MozTransform', + 'msTransform', 'OTransform'], + prop = properties[0]; + + /* Iterators */ + var i,j; + + /* Find out which CSS transform the browser supports */ + for(i=0,j=properties.length;i