function attachRollingBandwidthCalculation(n){try{if(+videojs.VERSION.split(".")[0]<8)throw new Error("videojs version too old");const t=[0,0,0,0,0,0];n.on("xhr-hooks-ready",()=>{const i=n.tech();i.vhs.xhr.onResponse((n,i)=>{if(navigator.connection&&navigator.connection.downlink){n.bandwidth=navigator.connection.downlink*1048576;return}try{const r=n.responseType==="arraybuffer"?n.response:n.responseText;if(r&&!i){const i=Date.now(),u=i-n.requestTime,f=r.byteLength||r.length,e=Math.round(f/u*8e3);n.responseType&&(t.shift(),t.push(e));n.bandwidth=Math.max(...t)*1.5}}catch(r){console.warn("Error when overriding bandwidth calculation",r)}})})}catch(t){console.warn("Could not override bandwidth calculation",t)}}!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],t):(n="undefined"!=typeof globalThis?globalThis:n||self).jbVideojsHlsQualitySelector=t(n.videojs)}(this,function(n){"use strict";function r(n){return n&&"object"==typeof n&&"default"in n?n:{"default":n}}var t=r(n);const u=t.default.getComponent("MenuButton"),f=t.default.getComponent("Menu"),e=t.default.getComponent("Component"),o=t.default.dom;class s extends u{constructor(n){super(n,{title:n.localize("Quality"),name:"QualityButton"})}createItems(){return[]}createMenu(){const t=new f(this.player_,{menuButton:this});if(t.addClass("hls-quality-button"),this.hideThreshold_=0,this.options_.title){const i=o.createEl("li",{className:"vjs-menu-title",innerHTML:(n=this.options_.title,"string"!=typeof n?n:n.charAt(0).toUpperCase()+n.slice(1)),tabIndex:-1}),r=new e(this.player_,{el:i});this.hideThreshold_+=1;t.addItem(r)}var n;if(this.items=this.createItems(),this.items)for(let n=0;nf?f:u;if(r&&!n.filter(n=>n.item&&n.item.value===r).length){const t=this.getQualityMenuItem.call(this,{label:r+"p",value:r});n.push(t)}}n.sort((n,t)=>"object"!=typeof n||"object"!=typeof t||n.item.valuet.item.value?1:0);n.push(this.getQualityMenuItem.call(this,{label:t.localize("Auto"),value:"auto",selected:!0}));this._qualityButton&&(this._qualityButton.createItems=function(){return n},this._qualityButton.update())}setQuality(n){const t=this.player.qualityLevels();this._currentQuality=n;this.config.displayCurrentQuality&&this.setButtonInnerText("auto"===n?this.player.localize("Auto"):`${n}p`);for(let i=0;iu?u:r;t[i].enabled=f===n||"auto"===n}this._qualityButton.unpressButton()}getCurrentQuality(){return this._currentQuality||"auto"}}const i=function(n){this.ready(()=>{((n,t)=>{n.addClass("vjs-hls-quality-selector"),n.hlsQualitySelector=new v(n,t)})(this,t.default.obj.merge(l,n))})};return a("hlsQualitySelector",i),i.VERSION="2.0.2",i}),function(n,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t(require("video.js"),require("global/document")):typeof define=="function"&&define.amd?define(["video.js","global/document"],t):n.videojsErrors=t(n.videojs,n.document)}(this,function(n,t){"use strict";n=n&&n.hasOwnProperty("default")?n["default"]:n;t=t&&t.hasOwnProperty("default")?t["default"]:t;var r="4.1.2",u=n.getComponent("Flash"),o=!n.browser.IS_IPHONE,s=n.registerPlugin||n.plugin,f={header:"",code:"",message:"",timeout:45e3,dismiss:o,progressDisabled:!1,errors:{"1":{type:"MEDIA_ERR_ABORTED",headline:"The video download was cancelled"},"2":{type:"MEDIA_ERR_NETWORK",headline:"The video connection was lost, please confirm you are connected to the internet"},"3":{type:"MEDIA_ERR_DECODE",headline:"The video is bad or in a format that cannot be played on your browser"},"4":{type:"MEDIA_ERR_SRC_NOT_SUPPORTED",headline:"This video is either unavailable or not supported in this browser"},"5":{type:"MEDIA_ERR_ENCRYPTED",headline:"The video you are trying to watch is encrypted and we do not know how to decrypt it"},unknown:{type:"MEDIA_ERR_UNKNOWN",headline:"An unanticipated problem was encountered, check back soon and try again"},"-1":{type:"PLAYER_ERR_NO_SRC",headline:"No video has been loaded"},"-2":{type:"PLAYER_ERR_TIMEOUT",headline:"Could not download the video"},PLAYER_ERR_DOMAIN_RESTRICTED:{headline:"This video is restricted from playing on your current domain"},PLAYER_ERR_IP_RESTRICTED:{headline:"This video is restricted at your current IP address"},PLAYER_ERR_GEO_RESTRICTED:{headline:"This video is restricted from playing in your current geographic region"},FLASHLS_ERR_CROSS_DOMAIN:{headline:"The video could not be loaded: crossdomain access denied."}}},e=function e(i,o){var l=void 0,a=void 0,v=void 0,y=[],w=function(t){o.errors=n.mergeOptions(o.errors,t);Object.keys(o.errors).forEach(function(n){var t=o.errors[n];t.type||(t.type=n)})};w();var h=function(){i.clearTimeout(a);v&&(v=!1,i.removeClass("vjs-waiting"));a=i.setTimeout(function(){i.error()||i.paused()||i.ended()||(v=!0,i.addClass("vjs-waiting"))},1e3);i.clearTimeout(l);l=i.setTimeout(function(){i.error()||i.paused()||i.ended()||i.error({code:-2,type:"PLAYER_ERR_TIMEOUT"})},o.timeout);i.error()&&i.error().code===-2&&i.error(null)},b=function(){for(var n=void 0;y.length;)n=y.shift(),i.off(n[0],n[1]);i.clearTimeout(l);i.clearTimeout(a)},k=function(n,t){var r=function(){if(!i.error()){var n=i.$(".vjs-tech");if(n&&n.type==="application/x-shockwave-flash"&&!n.vjs_getProperty){i.error({code:-2,type:"PLAYER_ERR_TIMEOUT"});return}if(i.paused()||i.ended())return h()}t.call(this)};i.on(n,r);y.push([n,r])},c=function(){var n=0;b();h();k(["timeupdate","adtimeupdate"],function(){var t=i.currentTime();t!==n&&(n=t,h())});o.progressDisabled||k("progress",h)},d=function(){i.currentSrc()||i.error({code:-1,type:"PLAYER_ERR_NO_SRC"})},g=function(){var h="",r=i.error(),e=t.createElement("div"),s="",c,f,l,a;if(r){if(r=n.mergeOptions(r,o.errors[r.code||r.type||0]),r.message&&(h='
'+i.localize("Technical details")+'\n :
'+i.localize(r.message)+"<\/div>\n <\/div>"),r.code===4&&u&&!u.isSupported()&&(c=i.localize("If you are using an older browser please try upgrading or installing Flash."),h+=''+c+"<\/span>"),f=i.getChild("errorDisplay"),e.className="vjs-errors-dialog",e.id="vjs-errors-dialog",s='
\n

'+this.localize(r.headline)+"<\/h2>\n
"+this.localize("Error Code")+"<\/b>: "+(r.type||r.code)+"<\/div>\n "+h+"\n <\/div>",l=f.closeable(!("dismiss"in r)||r.dismiss),l){s+='
\n