/** * tingtingan-videojs-hls-quality-selector * @version 1.1.10 * @copyright 2022 Chris Boustead (chris@forgemotion.com) * @license MIT */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],e):t.videojsHlsQualitySelector=e(t.videojs)}(this,function(o){"use strict";o=o&&o.hasOwnProperty("default")?o.default:o;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function t(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)}function s(t,e){if(t)return!e||"object"!=typeof e&&"function"!=typeof e?t:e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}var e=o.getComponent("MenuButton"),n=o.getComponent("Menu"),u=o.getComponent("Component"),r=o.dom;t(c,a=e),c.prototype.createItems=function(){return[]},c.prototype.createMenu=function(){var t,e=new n(this.player_,{menuButton:this});if(e.addClass("hls-quality-button"),this.hideThreshold_=0,this.options_.title&&(t=r.createEl("li",{className:"vjs-menu-title",innerHTML:"string"!=typeof(t=this.options_.title)?t:t.charAt(0).toUpperCase()+t.slice(1),tabIndex:-1}),t=new u(this.player_,{el:t}),this.hideThreshold_+=1,e.addItem(t)),this.items=this.createItems(),this.items)for(var i=0;ie.item.value?1:0}),l.push(this.getQualityMenuItem.call(this,{label:t.localize("Auto"),value:"auto",selected:!0})),this._qualityButton&&(this._qualityButton.createItems=function(){return l},this._qualityButton.update())},v.prototype.setQuality=function(t){var e=this.player.qualityLevels();this._currentQuality=t,this.config.displayCurrentQuality&&this.setButtonInnerText("auto"===t?this.player.localize("Auto"):t+"p");for(var i=0;i