1/*! For license information please see 175.c799e096.chunk.js.LICENSE.txt */ 2(self.webpackChunkthnk_client=self.webpackChunkthnk_client||[]).push([[175],{6175(t,e,l){t.exports=function(t){"use strict";function e(t){return t&&"object"===typeof t&&"default"in t?t:{default:t}}var l=e(t),s="2.0.0";const i=l.default.getComponent("MenuButton"),n=l.default.getComponent("Menu"),a=l.default.getComponent("Component"),u=l.default.dom;function o(t){return"string"!==typeof t?t:t.charAt(0).toUpperCase()+t.slice(1)}class h extends i{constructor(t){super(t,{title:t.localize("Quality"),name:"QualityButton"})}createItems(){return[]}createMenu(){const t=new n(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const e=u.createEl("li",{className:"vjs-menu-title",innerHTML:o(this.options_.title),tabIndex:-1}),l=new a(this.player_,{el:e});this.hideThreshold_+=1,t.addItem(l)}if(this.items=this.createItems(),this.items)for(let e=0;e<this.items.length;e++)t.addItem(this.items[e]);return t}}const r=l.default.getComponent("MenuItem");class c extends r{constructor(t,e,l,s){super(t,{label:e.label,selectable:!0,selected:e.selected||!1}),this.item=e,this.qualityButton=l,this.plugin=s}handleClick(){for(let t=0;t<this.qualityButton.items.length;++t)this.qualityButton.items[t].selected(!1);this.plugin.setQuality(this.item.value),this.selected(!0)}}const d=l.default.getPlugin("plugin"),y={};class p extends d{constructor(t,e){super(t),this.options=l.default.obj.merge(y,e),this.player.ready(()=>{this.player.qualityLevels&&(this.player.addClass("vjs-hls-quality-selector"),this.createQualityButton(),this.bindPlayerEvents())})}bindPlayerEvents(){this.player.qualityLevels().on("addqualitylevel",this.onAddQualityLevel.bind(this))}createQualityButton(){const t=this.player;this._qualityButton=new h(t);const e=t.controlBar.children().length-2,l=t.controlBar.addChild(this._qualityButton,{componentClass:"qualitySelector"},this.options.placementIndex||e);if(l.addClass("vjs-quality-selector"),this.options.displayCurrentQuality)this.setButtonInnerText(t.localize("Auto"));else{const t=" ".concat(this.options.vjsIconClass||"vjs-icon-hd");l.menuButton_.$(".vjs-icon-placeholder").className+=t}l.removeClass("vjs-hidden")}setButtonInnerText(t){this._qualityButton.menuButton_.$(".vjs-icon-placeholder").innerHTML=t}getQualityMenuItem(t){const e=this.player;return new c(e,t,this._qualityButton,this)}onAddQualityLevel(){const t=this.player.qualityLevels().levels_||[],e=[];for(let l=0;l<t.length;++l){const s=t[l],i=s.width,n=s.height,a=i>n?n:i;if(a&&!e.filter(t=>t.item&&t.item.value===a).length){const t=this.getQualityMenuItem.call(this,{label:a+"p",value:a});e.push(t)}}e.sort((t,e)=>"object"!==typeof t||"object"!==typeof e||t.item.value<e.item.value?-1:t.item.value>e.item.value?1:0),e.push(this.getQualityMenuItem.call(this,{label:this.player.localize("Auto"),value:"auto",selected:!0})),this._qualityButton&&(this._qualityButton.createItems=()=>e,this._qualityButton.update())}setQuality(t){const e=this.player.qualityLevels();this._currentQuality=t,this.options.displayCurrentQuality&&this.setButtonInnerText("auto"===t?this.player.localize("Auto"):"".concat(t,"p"));for(let l=0;l<e.length;++l){const s=e[l],i=s.width,n=s.height,a=i>n?n:i;e[l].enabled=a===t||"auto"===t}this._qualityButton.unpressButton()}getCurrentQuality(){return this._currentQuality||"auto"}}return p.VERSION=s,l.default.registerPlugin("hlsQualitySelector",p),p}(l(3006))}}]); 3//# sourceMappingURL=175.c799e096.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.