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