diff --git a/dist/videojs-settings.js b/dist/videojs-settings.js index 8522bd6..d696aa9 100644 --- a/dist/videojs-settings.js +++ b/dist/videojs-settings.js @@ -109,15 +109,12 @@ vjs.registerComponent('SettingsButton', vjs.extend(MenuButton, { var _this = this; var opt = this.options_; var menu = MenuButton.prototype.createMenu.call(this); - if (opt.show_settings_popup_on_click) - { - menu.addClass('vjs-menu-popup-on-click'); - // videojs removes the locking state on menu item click that causes - // settings button to hide without updating buttonPressed state - menu.children().forEach(function(component){ - component.on('click', function(){ _this.handleClick(); }); - }); - } + menu.addClass('vjs-menu-popup-on-click'); + // videojs removes the locking state on menu item click that causes + // settings button to hide without updating buttonPressed state + menu.children().forEach(function(component){ + component.on('click', function(){ _this.handleClick(); }); + }); return menu; }, handleClick: function(){ @@ -400,6 +397,8 @@ var QualityButton = vjs.getComponent('QualityButton'); vjs.plugin('settings', function(opt){ var video = this; + if (opt===undefined||opt===true) + opt = {info: true, report: true, quality: true}; opt = vjs.mergeOptions({}, opt); video.on('ready', function(){ function local_storage_set(key, value){ diff --git a/dist/videojs-settings.min.js b/dist/videojs-settings.min.js index a62e93e..fa7a09a 100644 --- a/dist/videojs-settings.min.js +++ b/dist/videojs-settings.min.js @@ -1 +1 @@ -!function(a,b){"use strict";function c(a){return"number"!=typeof a?a:Math.round(1e3*a)/1e3}var d,e,f,g=function(a,b){if(!b)return a;for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c]);return a},h=b.getComponent("Menu");b.registerComponent("PopupMenu",b.extend(h,{className:"vjs-rightclick-popup",popped:!1,constructor:function(a,c){h.call(this,a,c);var d=a;this.addClass(this.className),this.hide();var e=this,f=this.options_,g=b.mergeOptions({label:"Report playback issue"},f.report);this.addChild(new m(a,g));var i=b.mergeOptions({label:"Save logs to disk"});this.addChild(new n(a,i)),f.info&&(f.info=b.mergeOptions({label:"Technical info"},f.info),this.addChild(new o(a,f.info))),d.on("contextmenu",function(a){if(a.preventDefault(),e.popped)e.hide(),e.popped=!1;else{e.show();var b=a.offsetX,c=a.offsetY;e.el_.offsetWidth+b>d.el_.offsetWidth&&(b-=e.el_.offsetWidth),e.el_.offsetHeight+c>d.el_.offsetHeight&&(c-=e.el_.offsetHeight),e.el_.style.top=c+"px",e.el_.style.left=b+"px",e.popped=!0}}),d.on("click",function(a){return e.popped?(e.hide(),e.popped=!1,a.stopPropagation(),a.preventDefault(),!1):void 0}),this.children().forEach(function(a){a.on("click",function(a){e.hide(),e.popped=!1})})}}));var i=b.getComponent("MenuButton");b.registerComponent("SettingsButton",b.extend(i,{buttonText:"Settings",className:"vjs-settings-button",createItems:function(){this.addClass(this.className);var a=[],c=this.player_,d=this.options_;d.info&&(d.info=b.mergeOptions({label:"Technical info"},d.info),a.push(new o(c,d.info))),d.report&&(d.report=b.mergeOptions({label:"Report playback issue"},d.report),a.push(new m(c,d.report)));var e=d.quality,f=e&&e.sources?e.sources:null;if(f&&f.length>1){a.push(new p(c,{label:"Quality"}));for(var g=0;g=d)return c(b.end(e)-d);return"--"}},downloaded:{units:"sec",title:"Downloaded",get:function(a){var b=a.buffered(),d=0;if(b&&b.length)for(var e=0;ed.el_.offsetWidth&&(b-=e.el_.offsetWidth),e.el_.offsetHeight+c>d.el_.offsetHeight&&(c-=e.el_.offsetHeight),e.el_.style.top=c+"px",e.el_.style.left=b+"px",e.popped=!0}}),d.on("click",function(a){return e.popped?(e.hide(),e.popped=!1,a.stopPropagation(),a.preventDefault(),!1):void 0}),this.children().forEach(function(a){a.on("click",function(a){e.hide(),e.popped=!1})})}}));var i=b.getComponent("MenuButton");b.registerComponent("SettingsButton",b.extend(i,{buttonText:"Settings",className:"vjs-settings-button",createItems:function(){this.addClass(this.className);var a=[],c=this.player_,d=this.options_;d.info&&(d.info=b.mergeOptions({label:"Technical info"},d.info),a.push(new o(c,d.info))),d.report&&(d.report=b.mergeOptions({label:"Report playback issue"},d.report),a.push(new m(c,d.report)));var e=d.quality,f=e&&e.sources?e.sources:null;if(f&&f.length>1){a.push(new p(c,{label:"Quality"}));for(var g=0;g=d)return c(b.end(e)-d);return"--"}},downloaded:{units:"sec",title:"Downloaded",get:function(a){var b=a.buffered(),d=0;if(b&&b.length)for(var e=0;e