/*! * 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,o,n,r,i,l,u){var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},d="function"==typeof a[n]&&a[n],s=d.i||{},c=d.cache||{},f="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function p(t,o){if(!c[t]){if(!e[t]){if(r[t])return r[t];var i="function"==typeof a[n]&&a[n];if(!o&&i)return i(t,!0);if(d)return d(t,!0);if(f&&"string"==typeof t)return f(t);var l=Error("Cannot find module '"+t+"'");throw l.code="MODULE_NOT_FOUND",l}s.resolve=function(o){var n=e[t][1][o];return null!=n?n:o},s.cache={};var u=c[t]=new p.Module(t);e[t][0].call(u.exports,s,u,u.exports,a)}return c[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=f,this.exports={}},p.modules=e,p.cache=c,p.parent=d,p.distDir=void 0,p.publicUrl=void 0,p.devServer=void 0,p.i=s,p.register=function(t,o){e[t]=[function(e,t){t.exports=o},{}]},Object.defineProperty(p,"root",{get:function(){return a[n]}}),a[n]=p;for(var h=0;hs);var i=e("bundle-text:./quality.svg"),l=r.interopDefault(i),u=e("bundle-text:./audio.svg"),a=r.interopDefault(u);function d(e,t){let o=new Map;return e.filter(e=>{let n=e[t];return void 0===n||!o.has(n)&&o.set(n,1)})}function s(e={}){return t=>{let{$video:o}=t.template,{errorHandle:n}=t.constructor.utils;function r(){n(t.dash.getVideoElement()===o,'Cannot find instance of DASH from "art.dash"'),function(o){let n=o.getBitrateInfoListFor("video");if(!n||!n.length)return;let r=e.quality||{},i=r.auto||"Auto",u=r.title||"Quality",a=r.getName||(e=>`${e.height}p`),s=o.getQualityFor("video"),c=o.getSettings().streaming.abr.autoSwitchBitrate.video,f=c?i:a(n[s]),p=d(n.map(e=>({html:a(e),value:e.qualityIndex,default:s===e.qualityIndex&&!c})),"html").sort((e,t)=>t.value-e.value);p.push({html:i,value:"auto",default:c});let h=e=>("auto"===e.value?o.updateSettings({streaming:{abr:{autoSwitchBitrate:{video:!0}}}}):(o.updateSettings({streaming:{abr:{autoSwitchBitrate:{video:!1}}}}),o.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:p,onSelect:h}),r.setting&&t.setting.update({name:"dash-quality",tooltip:f,html:u,icon:l.default,width:200,selector:p,onSelect:h})}(t.dash),function(o){let n=o.getTracksFor("audio");if(!n||!n.length)return;let r=e.audio||{},i=r.auto||"Auto",l=r.title||"Audio",u=r.getName||(e=>e.lang||e.id),s=o.getCurrentTrackFor("audio")||n[0],c=s?u(s):i,f=d(n.map(e=>({html:u(e),value:e,default:s===e})),"html"),p=e=>(o.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:p}),r.setting&&t.setting.update({name:"dash-audio",tooltip:c,html:l,icon:a.default,width:200,selector:f,onSelect:p})}(t.dash)}return t.on("ready",r),t.on("restart",r),{name:"artplayerPluginDashControl",update:r}}}"undefined"!=typeof window&&(window.artplayerPluginDashControl=s)},{"bundle-text:./quality.svg":"5iEAx","bundle-text:./audio.svg":"909Xy","@parcel/transformer-js/src/esmodule-helpers.js":"w4pLy"}],"5iEAx":[function(e,t,o,n){t.exports=''},{}],"909Xy":[function(e,t,o,n){t.exports=''},{}],w4pLy:[function(e,t,o,n){o.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},o.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{value:!0})},o.exportAll=function(e,t){return Object.keys(e).forEach(function(o){"default"===o||"__esModule"===o||Object.prototype.hasOwnProperty.call(t,o)||Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[o]}})}),t},o.export=function(e,t,o){Object.defineProperty(e,t,{enumerable:!0,get:o})}},{}]},["4omrA"],"4omrA","parcelRequiree167",{});let{default:e}=parcelRequiree167("4omrA");export{e as default}; //# sourceMappingURL=artplayer-plugin-dash-control.esm.js.map