/*! * 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,r){var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},l="function"==typeof i[o]&&i[o],u=l.cache||{},a="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function d(t,n){if(!u[t]){if(!e[t]){var r="function"==typeof i[o]&&i[o];if(!n&&r)return r(t,!0);if(l)return l(t,!0);if(a&&"string"==typeof t)return a(t);var s=Error("Cannot find module '"+t+"'");throw s.code="MODULE_NOT_FOUND",s}f.resolve=function(n){var o=e[t][1][n];return null!=o?o:n},f.cache={};var c=u[t]=new d.Module(t);e[t][0].call(c.exports,f,c,c.exports,this)}return u[t].exports;function f(e){var t=f.resolve(e);return!1===t?{}:d(t)}}d.isParcelRequire=!0,d.Module=function(e){this.id=e,this.bundle=d,this.exports={}},d.modules=e,d.cache=u,d.parent=l,d.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(d,"root",{get:function(){return i[o]}}),i[o]=d;for(var s=0;sd);var r=e("bundle-text:./quality.svg"),i=o.interopDefault(r),l=e("bundle-text:./audio.svg"),u=o.interopDefault(l);function a(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 d(e={}){return t=>{let{$video:n}=t.template,{errorHandle:o}=t.constructor.utils;function r(){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 r=e.quality||{},l=r.auto||"Auto",u=r.title||"Quality",d=r.getName||(e=>`${e.height}p`),s=n.getQualityFor("video"),c=n.getSettings().streaming.abr.autoSwitchBitrate.video,f=c?l:d(o[s]),h=a(o.map(e=>({html:d(e),value:e.qualityIndex,default:s===e.qualityIndex&&!c})),"html").sort((e,t)=>t.value-e.value);h.push({html:l,value:"auto",default:c});let p=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}`,r.control&&t.controls.check(e),r.setting&&t.setting.check(e),e.html);r.control&&t.controls.update({name:"dash-quality",position:"right",html:f,style:{padding:"0 10px"},selector:h,onSelect:p}),r.setting&&t.setting.update({name:"dash-quality",tooltip:f,html:u,icon:i.default,width:200,selector:h,onSelect:p})}(t.dash),function(n){let o=n.getTracksFor("audio");if(!o||!o.length)return;let r=e.audio||{},i=r.auto||"Auto",l=r.title||"Audio",d=r.getName||(e=>e.lang||e.id),s=n.getCurrentTrackFor("audio")||o[0],c=s?d(s):i,f=a(o.map(e=>({html:d(e),value:e,default:s===e})),"html"),h=e=>(n.setCurrentTrack(e.value),t.notice.show=`${l}: ${e.html}`,r.control&&t.controls.check(e),r.setting&&t.setting.check(e),e.html);r.control&&t.controls.update({name:"dash-audio",position:"right",html:c,style:{padding:"0 10px"},selector:f,onSelect:h}),r.setting&&t.setting.update({name:"dash-audio",tooltip:c,html:l,icon:u.default,width:200,selector:f,onSelect:h})}(t.dash)}return t.on("ready",r),t.on("restart",r),{name:"artplayerPluginDashControl",update:r}}}"undefined"!=typeof window&&(window.artplayerPluginDashControl=d)},{"bundle-text:./quality.svg":"aRkFd","bundle-text:./audio.svg":"hfT2T","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],aRkFd:[function(e,t,n){t.exports=''},{}],hfT2T:[function(e,t,n){t.exports=''},{}],"9pCYc":[function(e,t,n){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})}},{}]},["hRBuj"],"hRBuj","parcelRequire4dc0");