/*! * artplayer-plugin-dash-control.js v1.0.0 * Github: https://github.com/zhw2590582/ArtPlayer * (c) 2017-2025 Harvey Zack * Released under the MIT License. */ !function(e,t,n,o,i,r,u,l){var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},d="function"==typeof a[o]&&a[o],s=d.i||{},f=d.cache||{},c="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function p(t,n){if(!f[t]){if(!e[t]){if(i[t])return i[t];var r="function"==typeof a[o]&&a[o];if(!n&&r)return r(t,!0);if(d)return d(t,!0);if(c&&"string"==typeof t)return c(t);var u=Error("Cannot find module '"+t+"'");throw u.code="MODULE_NOT_FOUND",u}s.resolve=function(n){var o=e[t][1][n];return null!=o?o:n},s.cache={};var l=f[t]=new p.Module(t);e[t][0].call(l.exports,s,l,l.exports,a)}return f[t].exports;function s(e){var t=s.resolve(e);return!1===t?{}:p(t)}}p.isParcelRequire=!0,p.Module=function(e){this.id=e,this.bundle=p,this.require=c,this.exports={}},p.modules=e,p.cache=f,p.parent=d,p.distDir=void 0,p.publicUrl=void 0,p.devServer=void 0,p.i=s,p.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(p,"root",{get:function(){return a[o]}}),a[o]=p;for(var h=0;hs);var r=e("bundle-text:./audio.svg"),u=i.interopDefault(r),l=e("bundle-text:./quality.svg"),a=i.interopDefault(l);function d(e,t){let n=new Map;return e.filter(e=>{let o=e[t];return void 0===o||!n.has(o)&&n.set(o,1)})}function s(e={}){return t=>{let{$video:n}=t.template,{errorHandle:o}=t.constructor.utils;function i(){o(t.dash.getVideoElement()===n,'Cannot find instance of DASH from "art.dash"'),function(n){let o=n.getBitrateInfoListFor("video");if(!o||!o.length)return;let i=e.quality||{},r=i.auto||"Auto",u=i.title||"Quality",l=i.getName||(e=>`${e.height}p`),s=n.getQualityFor("video"),f=n.getSettings().streaming.abr.autoSwitchBitrate.video,c=f?r:l(o[s]),p=d(o.map(e=>({html:l(e),value:e.qualityIndex,default:s===e.qualityIndex&&!f})),"html").sort((e,t)=>t.value-e.value);p.push({html:r,value:"auto",default:f});let h=e=>("auto"===e.value?n.updateSettings({streaming:{abr:{autoSwitchBitrate:{video:!0}}}}):(n.updateSettings({streaming:{abr:{autoSwitchBitrate:{video:!1}}}}),n.setQualityFor("video",e.value)),t.notice.show=`${u}: ${e.html}`,i.control&&t.controls.check(e),i.setting&&t.setting.check(e),e.html);i.control&&t.controls.update({name:"dash-quality",position:"right",html:c,style:{padding:"0 10px"},selector:p,onSelect:h}),i.setting&&t.setting.update({name:"dash-quality",tooltip:c,html:u,icon:a.default,width:200,selector:p,onSelect:h})}(t.dash),function(n){let o=n.getTracksFor("audio");if(!o||!o.length)return;let i=e.audio||{},r=i.auto||"Auto",l=i.title||"Audio",a=i.getName||(e=>e.lang||e.id),s=n.getCurrentTrackFor("audio")||o[0],f=s?a(s):r,c=d(o.map(e=>({html:a(e),value:e,default:s===e})),"html"),p=e=>(n.setCurrentTrack(e.value),t.notice.show=`${l}: ${e.html}`,i.control&&t.controls.check(e),i.setting&&t.setting.check(e),e.html);i.control&&t.controls.update({name:"dash-audio",position:"right",html:f,style:{padding:"0 10px"},selector:c,onSelect:p}),i.setting&&t.setting.update({name:"dash-audio",tooltip:f,html:l,icon:u.default,width:200,selector:c,onSelect:p})}(t.dash)}return t.on("ready",i),t.on("restart",i),{name:"artplayerPluginDashControl",update:i}}}"undefined"!=typeof window&&(window.artplayerPluginDashControl=s)},{"bundle-text:./audio.svg":"1dVMq","bundle-text:./quality.svg":"hfm0m","@parcel/transformer-js/src/esmodule-helpers.js":"6ykb1"}],"1dVMq":[function(e,t,n,o){t.exports=''},{}],hfm0m:[function(e,t,n,o){t.exports=''},{}],"6ykb1":[function(e,t,n,o){n.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},n.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.exportAll=function(e,t){return Object.keys(e).forEach(function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[n]}})}),t},n.export=function(e,t,n){Object.defineProperty(e,t,{enumerable:!0,get:n})}},{}]},["fpgdj"],"fpgdj","parcelRequire4dc0",{});