Files
ArtPlayer/docs/compiled/artplayer-plugin-dash-control.legacy.js
T
2025-04-20 10:12:14 +08:00

8 lines
5.4 KiB
JavaScript

/*!
* 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,i,u,a){var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},c="function"==typeof l[o]&&l[o],d=c.i||{},f=c.cache||{},s="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function p(t,n){if(!f[t]){if(!e[t]){if(r[t])return r[t];var i="function"==typeof l[o]&&l[o];if(!n&&i)return i(t,!0);if(c)return c(t,!0);if(s&&"string"==typeof t)return s(t);var u=Error("Cannot find module '"+t+"'");throw u.code="MODULE_NOT_FOUND",u}d.resolve=function(n){var o=e[t][1][n];return null!=o?o:n},d.cache={};var a=f[t]=new p.Module(t);e[t][0].call(a.exports,d,a,a.exports,l)}return f[t].exports;function d(e){var t=d.resolve(e);return!1===t?{}:p(t)}}p.isParcelRequire=!0,p.Module=function(e){this.id=e,this.bundle=p,this.require=s,this.exports={}},p.modules=e,p.cache=f,p.parent=c,p.distDir=void 0,p.publicUrl=void 0,p.devServer=void 0,p.i=d,p.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(p,"root",{get:function(){return l[o]}}),l[o]=p;for(var h=0;h<t.length;h++)p(t[h]);if(n){var g=p(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=g:"function"==typeof define&&define.amd&&define(function(){return g})}}({cjCOF:[function(e,t,n,o){var r=e("@parcel/transformer-js/src/esmodule-helpers.js");r.defineInteropFlag(n),r.export(n,"default",function(){return d});var i=e("bundle-text:./quality.svg"),u=r.interopDefault(i),a=e("bundle-text:./audio.svg"),l=r.interopDefault(a);function c(e,t){var n=new Map;return e.filter(function(e){var o=e[t];return void 0===o||!n.has(o)&&n.set(o,1)})}function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var n=t.template.$video,o=t.constructor.utils.errorHandle;function r(){o(t.dash.getVideoElement()===n,'Cannot find instance of DASH from "art.dash"'),function(n){var o=n.getBitrateInfoListFor("video");if(o&&o.length){var r=e.quality||{},i=r.auto||"Auto",a=r.title||"Quality",l=r.getName||function(e){return"".concat(e.height,"p")},d=n.getQualityFor("video"),f=n.getSettings().streaming.abr.autoSwitchBitrate.video,s=f?i:l(o[d]),p=c(o.map(function(e){return{html:l(e),value:e.qualityIndex,default:d===e.qualityIndex&&!f}}),"html").sort(function(e,t){return t.value-e.value});p.push({html:i,value:"auto",default:f});var h=function(e){return"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="".concat(a,": ").concat(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:s,style:{padding:"0 10px"},selector:p,onSelect:h}),r.setting&&t.setting.update({name:"dash-quality",tooltip:s,html:a,icon:u.default,width:200,selector:p,onSelect:h})}}(t.dash),function(n){var o=n.getTracksFor("audio");if(o&&o.length){var r=e.audio||{},i=r.auto||"Auto",u=r.title||"Audio",a=r.getName||function(e){return e.lang||e.id},d=n.getCurrentTrackFor("audio")||o[0],f=d?a(d):i,s=c(o.map(function(e){return{html:a(e),value:e,default:d===e}}),"html"),p=function(e){return n.setCurrentTrack(e.value),t.notice.show="".concat(u,": ").concat(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:f,style:{padding:"0 10px"},selector:s,onSelect:p}),r.setting&&t.setting.update({name:"dash-audio",tooltip:f,html:u,icon:l.default,width:200,selector:s,onSelect:p})}}(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":"eOZxP","bundle-text:./audio.svg":"2wNMP","@parcel/transformer-js/src/esmodule-helpers.js":"iWrD0"}],eOZxP:[function(e,t,n,o){t.exports='<svg xmlns="http://www.w3.org/2000/svg" height="18" viewBox="0 0 512 512"><path fill="#fff" d="M0 96c0-35.3 28.7-64 64-64h384c35.3 0 64 28.7 64 64v320c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64zm323.8 106.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6-26.5-33.1c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4S78.8 416 88 416h336c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96"/></svg>'},{}],"2wNMP":[function(e,t,n,o){t.exports='<svg xmlns="http://www.w3.org/2000/svg" height="18" viewBox="0 0 512 512"><path fill="#fff" d="M256 80C149.9 80 62.4 159.4 49.6 262c9.4-3.8 19.6-6 30.4-6 26.5 0 48 21.5 48 48v128c0 26.5-21.5 48-48 48-44.2 0-80-35.8-80-80V288C0 146.6 114.6 32 256 32s256 114.6 256 256v112c0 44.2-35.8 80-80 80-26.5 0-48-21.5-48-48V304c0-26.5 21.5-48 48-48 10.8 0 21 2.1 30.4 6C449.6 159.4 362.1 80 256 80"/></svg>'},{}],iWrD0:[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})}},{}]},["cjCOF"],"cjCOF","parcelRequire4dc0",{});