Files
ArtPlayer/docs/compiled/artplayer-plugin-dash-control.legacy.js
T

8 lines
5.3 KiB
JavaScript

/*!
* artplayer-plugin-dash-control.js v1.0.0
* Github: https://github.com/zhw2590582/ArtPlayer
* (c) 2017-2024 Harvey Zack
* Released under the MIT License.
*/
!function(t,e,n,o,r){var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},u="function"==typeof i[o]&&i[o],a=u.cache||{},l="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function c(e,n){if(!a[e]){if(!t[e]){var r="function"==typeof i[o]&&i[o];if(!n&&r)return r(e,!0);if(u)return u(e,!0);if(l&&"string"==typeof e)return l(e);var d=Error("Cannot find module '"+e+"'");throw d.code="MODULE_NOT_FOUND",d}s.resolve=function(n){var o=t[e][1][n];return null!=o?o:n},s.cache={};var f=a[e]=new c.Module(e);t[e][0].call(f.exports,s,f,f.exports,this)}return a[e].exports;function s(t){var e=s.resolve(t);return!1===e?{}:c(e)}}c.isParcelRequire=!0,c.Module=function(t){this.id=t,this.bundle=c,this.exports={}},c.modules=t,c.cache=a,c.parent=u,c.register=function(e,n){t[e]=[function(t,e){e.exports=n},{}]},Object.defineProperty(c,"root",{get:function(){return i[o]}}),i[o]=c;for(var d=0;d<e.length;d++)c(e[d]);if(n){var f=c(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=f:"function"==typeof define&&define.amd&&define(function(){return f})}}({cjCOF:[function(t,e,n){var o=t("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(n),o.export(n,"default",function(){return c});var r=t("bundle-text:./quality.svg"),i=o.interopDefault(r),u=t("bundle-text:./audio.svg"),a=o.interopDefault(u);function l(t,e){var n=new Map;return t.filter(function(t){var o=t[e];return void 0===o||!n.has(o)&&n.set(o,1)})}function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var n=e.template.$video,o=e.constructor.utils.errorHandle;function r(){o(e.dash.getVideoElement()===n,'Cannot find instance of DASH from "art.dash"'),function(n){var o=n.getBitrateInfoListFor("video");if(o&&o.length){var r=t.quality||{},u=r.auto||"Auto",a=r.title||"Quality",c=r.getName||function(t){return"".concat(t.height,"p")},d=n.getQualityFor("video"),f=n.getSettings().streaming.abr.autoSwitchBitrate.video,s=f?u:c(o[d]),p=l(o.map(function(t){return{html:c(t),value:t.qualityIndex,default:d===t.qualityIndex&&!f}}),"html").sort(function(t,e){return e.value-t.value});p.push({html:u,value:"auto",default:f});var h=function(t){return"auto"===t.value?n.updateSettings({streaming:{abr:{autoSwitchBitrate:{video:!0}}}}):(n.updateSettings({streaming:{abr:{autoSwitchBitrate:{video:!1}}}}),n.setQualityFor("video",t.value)),e.notice.show="".concat(a,": ").concat(t.html),r.control&&e.controls.check(t),r.setting&&e.setting.check(t),t.html};r.control&&e.controls.update({name:"dash-quality",position:"right",html:s,style:{padding:"0 10px"},selector:p,onSelect:h}),r.setting&&e.setting.update({name:"dash-quality",tooltip:s,html:a,icon:i.default,width:200,selector:p,onSelect:h})}}(e.dash),function(n){var o=n.getTracksFor("audio");if(o&&o.length){var r=t.audio||{},i=r.auto||"Auto",u=r.title||"Audio",c=r.getName||function(t){return t.lang||t.id},d=n.getCurrentTrackFor("audio")||o[0],f=d?c(d):i,s=l(o.map(function(t){return{html:c(t),value:t,default:d===t}}),"html"),p=function(t){return n.setCurrentTrack(t.value),e.notice.show="".concat(u,": ").concat(t.html),r.control&&e.controls.check(t),r.setting&&e.setting.check(t),t.html};r.control&&e.controls.update({name:"dash-audio",position:"right",html:f,style:{padding:"0 10px"},selector:s,onSelect:p}),r.setting&&e.setting.update({name:"dash-audio",tooltip:f,html:u,icon:a.default,width:200,selector:s,onSelect:p})}}(e.dash)}return e.on("ready",r),e.on("restart",r),{name:"artplayerPluginDashControl",update:r}}}"undefined"!=typeof window&&(window.artplayerPluginDashControl=c)},{"bundle-text:./quality.svg":"eOZxP","bundle-text:./audio.svg":"2wNMP","@parcel/transformer-js/src/esmodule-helpers.js":"iWrD0"}],eOZxP:[function(t,e,n){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" height="18"><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-64V96zm323.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.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"/></svg>'},{}],"2wNMP":[function(t,e,n){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" height="18"><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 80z"/></svg>'},{}],iWrD0:[function(t,e,n){n.interopDefault=function(t){return t&&t.__esModule?t:{default:t}},n.defineInteropFlag=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.exportAll=function(t,e){return Object.keys(t).forEach(function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})}),e},n.export=function(t,e,n){Object.defineProperty(t,e,{enumerable:!0,get:n})}},{}]},["cjCOF"],"cjCOF","parcelRequire4dc0");