Exemplo n.º 1
0
define("bundles/videojs/plugins/volumeMenuButton",["require","exports","module","bundles/videojs/layout/controls.html","videojs","jquery"],function(require,exports,module){"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var t=function(){function defineProperties(n,o){for(var t=0;t<o.length;t++){var e=o[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}return function(e,t,o){return t&&defineProperties(e.prototype,t),o&&defineProperties(e,o),e}}(),o=function get(e,o,n){null===e&&(e=Function.prototype);var t=Object.getOwnPropertyDescriptor(e,o);if(void 0===t){var r=Object.getPrototypeOf(e);return null===r?void 0:get(r,o,n)}if("value"in t)return t.value;var u=t.get;if(void 0===u)return void 0;return u.call(n)},n=require("bundles/videojs/layout/controls.html"),e=require("videojs"),$=require("jquery"),r=function(e){function CVolumeMenuButton(){return _classCallCheck(this,CVolumeMenuButton),_possibleConstructorReturn(this,Object.getPrototypeOf(CVolumeMenuButton).apply(this,arguments))}return _inherits(CVolumeMenuButton,e),t(CVolumeMenuButton,[{key:"createEl",value:function createEl(){var e=$(n({controlName:"volumeMenuButton"}))[0];return this.createControlTextEl(e),e}},{key:"volumeUpdate",value:function volumeUpdate(){o(Object.getPrototypeOf(CVolumeMenuButton.prototype),"volumeUpdate",this).call(this);var t=this.player().volume(),e=$(this.contentEl().querySelector('[data-js="video-control-icon"]'));0===t||this.player().muted()?(e.removeClass("cif-volume-up cif-volume-down"),e.addClass("cif-volume-off")):.33>t?(e.removeClass("cif-volume-up cif-volume-off"),e.addClass("cif-volume-down")):(e.removeClass("cif-volume-down cif-volume-off"),e.addClass("cif-volume-up"))}}]),CVolumeMenuButton}(e.getComponent("VolumeMenuButton"));e.registerComponent("CVolumeMenuButton",r)});
Exemplo n.º 2
0
define("bundles/videojs/plugins/autoplayMenuSection",["require","exports","module","jquery","videojs","bundles/videojs/layout/autoplayMenuSection.html"],function(require,exports,module){"use strict";function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(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)}var e=function(){function defineProperties(n,o){for(var e=0;e<o.length;e++){var t=o[e];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(n,t.key,t)}}return function(t,e,o){return e&&defineProperties(t.prototype,e),o&&defineProperties(t,o),t}}(),$=require("jquery"),t=require("videojs"),o=require("bundles/videojs/layout/autoplayMenuSection.html"),n=function(t){function AutoplayMenuSection(e,o){_classCallCheck(this,AutoplayMenuSection);var t=_possibleConstructorReturn(this,Object.getPrototypeOf(AutoplayMenuSection).call(this,e,o));return $(t.el_).find('[data-js="autoplay-off-button"]').click(t.onAutoplayOff.bind(t)),$(t.el_).find('[data-js="autoplay-on-button"]').click(t.onAutoplayOn.bind(t)),e.autoplay()?$(t.el_).find('[data-js="autoplay-on-button"]').addClass("selected"):$(t.el_).find('[data-js="autoplay-off-button"]').addClass("selected"),t}return _inherits(AutoplayMenuSection,t),e(AutoplayMenuSection,[{key:"createEl",value:function createEl(t,e){return $(o())[0]}},{key:"onAutoplayOff",value:function onAutoplayOff(t,e){$(this.el_).find('[data-js="autoplay-off-button"]').addClass("selected"),$(this.el_).find('[data-js="autoplay-on-button"]').removeClass("selected"),this.player_.autoplay(!1),this.player_.trigger("autoplaychange")}},{key:"onAutoplayOn",value:function onAutoplayOn(t,e){$(this.el_).find('[data-js="autoplay-off-button"]').removeClass("selected"),$(this.el_).find('[data-js="autoplay-on-button"]').addClass("selected"),this.player_.autoplay(!0),this.player_.trigger("autoplaychange")}}]),AutoplayMenuSection}(t.getComponent("Component"));t.registerComponent("AutoplayMenuSection",n)});
Exemplo n.º 3
0
define("bundles/videojs/plugins/resolutionMenuSection",["require","exports","module","bundles/videojs/layout/resolutionMenuSection.html","videojs","i18n!bundles/videojs/layout/nls/resolutionMenuSection","jquery","bundles/videojs/plugins/resolutions"],function(require,exports,module){"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var n=function(){function defineProperties(o,n){for(var t=0;t<n.length;t++){var e=n[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(o,e.key,e)}}return function(e,t,n){return t&&defineProperties(e.prototype,t),n&&defineProperties(e,n),e}}(),o=require("bundles/videojs/layout/resolutionMenuSection.html"),t=require("videojs"),e=require("i18n!bundles/videojs/layout/nls/resolutionMenuSection"),$=require("jquery");require("bundles/videojs/plugins/resolutions");var i=function(t){function ResolutionMenuSection(t,o){_classCallCheck(this,ResolutionMenuSection);var n=_possibleConstructorReturn(this,Object.getPrototypeOf(ResolutionMenuSection).call(this,t,o));return n.options_={name:"resolutionMenuSection"},n.resolutionNames_={"360p":e("Low"),"540p":e("Medium"),"720p":e("High")},t.on("resolutionchange",n.updateResolutionText.bind(n)),n.one(t,"ready",function(){$(this.el_).find('[data-js="decrease-resolution-button"]').click(t.decreaseResolution.bind(t)),$(this.el_).find('[data-js="increase-resolution-button"]').click(t.increaseResolution.bind(t)),this.updateResolutionText()}),n}return _inherits(ResolutionMenuSection,t),n(ResolutionMenuSection,[{key:"createEl",value:function createEl(e,t){return $(o())[0]}},{key:"updateResolutionText",value:function updateResolutionText(){var e=this.player_.resolution(),t=this.resolutionNames_[e]||e;$(this.el_).find('[data-js="resolution-text"]').text(t)}}]),ResolutionMenuSection}(t.getComponent("Component"));t.registerComponent("ResolutionMenuSection",i)});
Exemplo n.º 4
0
define("bundles/videojs/plugins/playToggle",["require","exports","module","videojs","jquery","bundles/videojs/layout/controls.html"],function(require,exports,module){"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var t=function(){function defineProperties(n,o){for(var t=0;t<o.length;t++){var e=o[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}return function(e,t,o){return t&&defineProperties(e.prototype,t),o&&defineProperties(e,o),e}}(),e=require("videojs"),$=require("jquery"),o=require("bundles/videojs/layout/controls.html"),n=function(e){function CPlayToggle(e,n){_classCallCheck(this,CPlayToggle);var t=_possibleConstructorReturn(this,Object.getPrototypeOf(CPlayToggle).call(this,e,n)),o=t.contentEl().querySelector('[data-js="video-control-icon"]');return e.on("play",function(){$(o).removeClass("cif-play").addClass("cif-pause")}),e.on("pause",function(){$(o).removeClass("cif-pause").addClass("cif-play")}),t}return _inherits(CPlayToggle,e),t(CPlayToggle,[{key:"createEl",value:function createEl(){var e=$(o({controlName:"playToggle"}))[0];return this.createControlTextEl(e),e}}]),CPlayToggle}(e.getComponent("PlayToggle"));e.registerComponent("CPlayToggle",n)});
Exemplo n.º 5
0
define("bundles/videojs/plugins/playbackRateMenuSection",["require","exports","module","bundles/videojs/layout/playbackRateMenuSection.html","videojs","jquery","underscore"],function(require,exports,module){"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var t=function(){function defineProperties(n,a){for(var t=0;t<a.length;t++){var e=a[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}return function(e,t,a){return t&&defineProperties(e.prototype,t),a&&defineProperties(e,a),e}}(),a=require("bundles/videojs/layout/playbackRateMenuSection.html"),e=require("videojs"),$=require("jquery"),_=require("underscore"),n=function(n){function PlaybackRateMenuSection(a,n){_classCallCheck(this,PlaybackRateMenuSection);var t=_possibleConstructorReturn(this,Object.getPrototypeOf(PlaybackRateMenuSection).call(this,a,n));return t.options_={name:"playbackRateMenuSection"},t.playbackRates_=[.75,1,1.25,1.5,1.75,2],$(t.el_).find('[data-js="c-playback-rate-minus-button"]').click(t.decreasePlaybackRate.bind(t)),$(t.el_).find('[data-js="c-playback-rate-plus-button"]').click(t.increasePlaybackRate.bind(t)),t.player_.on("ratechange",e.bind(t,t.changeRateText)),t.changeRateText.call(t),t}return _inherits(PlaybackRateMenuSection,n),t(PlaybackRateMenuSection,[{key:"name",value:function name(){return"PlaybackRateMenuSection"}},{key:"createEl",value:function createEl(e,t){return $(a())[0]}},{key:"changeRateText",value:function changeRateText(){var e=this.player_.playbackRate().toFixed(2)+"x";$(this.el_).find('[data-js="c-playback-rate-text"]').text(e)}},{key:"getRateIndex",value:function getRateIndex(){return _.indexOf(this.playbackRates_,this.player_.playbackRate()||1)}},{key:"decreasePlaybackRate",value:function decreasePlaybackRate(){if(this.player_.playbackRate()===_.first(this.playbackRates_))return;this.player_.options().playbackRates&&this.player_.playbackRate(this.playbackRates_[this.getRateIndex()-1])}},{key:"increasePlaybackRate",value:function increasePlaybackRate(){if(this.player_.playbackRate()===_.last(this.playbackRates_))return;this.player_.options().playbackRates&&this.player_.playbackRate(this.playbackRates_[this.getRateIndex()+1])}}]),PlaybackRateMenuSection}(e.getComponent("Component"));e.registerComponent("PlaybackRateMenuSection",n)});