Files
ArtPlayer/docs/compiled/artplayer-plugin-hls-control.mjs.map
T
Harvey Zack c911928166 feat: add danmuku plugin documentation and i18n setup
- Created a new documentation file for the danmuku plugin with interactive code execution.
- Added comprehensive i18n setup instructions, including default language settings, language imports, and examples for adding and modifying languages.
- Introduced a test file to verify the integration of the danmuku plugin.
2025-08-17 12:09:50 +08:00

1 line
23 KiB
Plaintext

{"mappings":"C,A,S,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,E,I,E,A,a,O,W,W,A,a,O,K,K,A,a,O,O,O,A,a,O,O,O,C,E,E,A,Y,O,C,C,E,E,C,C,E,C,E,E,C,E,C,E,E,E,K,E,C,E,E,A,a,O,Q,A,Y,O,O,O,E,O,O,C,I,C,Q,S,E,C,C,C,E,G,C,C,C,E,C,C,G,C,C,C,E,C,C,G,C,C,E,C,O,C,C,E,C,I,E,A,Y,O,C,C,E,E,C,C,E,C,G,C,G,E,O,E,E,C,G,G,E,O,E,E,C,G,G,G,A,U,O,E,O,E,G,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,O,C,S,C,E,I,E,C,C,E,C,E,C,E,C,O,A,M,E,E,C,E,E,K,C,C,E,I,E,C,C,E,C,I,E,M,C,G,C,C,E,C,E,C,I,C,E,O,C,E,E,E,O,C,E,C,O,C,C,E,C,O,C,S,E,C,E,I,E,E,O,C,G,M,A,C,I,E,C,E,E,E,C,C,E,e,C,C,E,E,M,C,S,C,E,I,C,E,C,E,I,C,M,C,E,I,C,O,C,E,I,C,O,C,C,C,E,E,O,C,E,E,K,C,E,E,M,C,E,E,O,C,K,E,E,S,C,K,E,E,S,C,K,E,E,C,C,E,E,Q,C,S,C,C,C,E,C,C,E,C,C,S,C,C,C,E,E,O,C,C,E,C,E,A,E,O,c,C,E,O,C,I,W,O,C,C,E,A,C,G,C,C,E,C,E,I,I,E,E,E,E,M,C,I,E,C,C,E,E,G,E,C,I,E,E,E,A,C,U,O,S,A,a,O,O,O,O,C,E,A,Y,O,Q,O,G,E,O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xC,OAjBA,OAAO,IAAI,CAAC,GAAQ,OAAO,CAAC,SAAU,CAAG,EAE7B,YAAR,GACA,AAAQ,eAAR,GACA,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,EAAM,IAK7C,OAAO,cAAc,CAAC,EAAM,EAAK,CAC/B,WAAY,CAAA,EACZ,IAAK,WACH,OAAO,CAAM,CAAC,EAAI,AACpB,CACF,EACF,GAEO,CACT,EAEA,EAAQ,MAAM,CAAG,SAAU,CAAI,CAAE,CAAQ,CAAE,CAAG,EAC5C,OAAO,cAAc,CAAC,EAAM,EAAU,CACpC,WAAY,CAAA,EACZ,IAAK,CACP,EACF,C,E,C,E,E,C,Q,C,Q,oB,C,G,G,C,Q,C,C,C,kB,gB,K,O","sources":["<anon>","packages/artplayer-plugin-hls-control/src/index.js","node_modules/@parcel/runtime-js/lib/bundles/runtime-f074e76d4300b8ac.js","node_modules/@parcel/runtime-js/lib/bundles/runtime-cd7c8aead227e587.js","node_modules/@parcel/transformer-js/src/esmodule-helpers.js"],"sourcesContent":["// modules are defined as an array\n// [ module function, map of requires ]\n//\n// map of requires is short require name -> numeric require\n//\n// anything defined in a previous bundle is accessed via the\n// orig method which is the require for previous bundles\n\n(function (\n modules,\n entry,\n mainEntry,\n parcelRequireName,\n externals,\n distDir,\n publicUrl,\n devServer\n) {\n /* eslint-disable no-undef */\n var globalObject =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n /* eslint-enable no-undef */\n\n // Save the require from previous bundle to this closure if any\n var previousRequire =\n typeof globalObject[parcelRequireName] === 'function' &&\n globalObject[parcelRequireName];\n\n var importMap = previousRequire.i || {};\n var cache = previousRequire.cache || {};\n // Do not use `require` to prevent Webpack from trying to bundle this call\n var nodeRequire =\n typeof module !== 'undefined' &&\n typeof module.require === 'function' &&\n module.require.bind(module);\n\n function newRequire(name, jumped) {\n if (!cache[name]) {\n if (!modules[name]) {\n if (externals[name]) {\n return externals[name];\n }\n // if we cannot find the module within our internal map or\n // cache jump to the current global require ie. the last bundle\n // that was added to the page.\n var currentRequire =\n typeof globalObject[parcelRequireName] === 'function' &&\n globalObject[parcelRequireName];\n if (!jumped && currentRequire) {\n return currentRequire(name, true);\n }\n\n // If there are other bundles on this page the require from the\n // previous one is saved to 'previousRequire'. Repeat this as\n // many times as there are bundles until the module is found or\n // we exhaust the require chain.\n if (previousRequire) {\n return previousRequire(name, true);\n }\n\n // Try the node require function if it exists.\n if (nodeRequire && typeof name === 'string') {\n return nodeRequire(name);\n }\n\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n }\n\n localRequire.resolve = resolve;\n localRequire.cache = {};\n\n var module = (cache[name] = new newRequire.Module(name));\n\n modules[name][0].call(\n module.exports,\n localRequire,\n module,\n module.exports,\n globalObject\n );\n }\n\n return cache[name].exports;\n\n function localRequire(x) {\n var res = localRequire.resolve(x);\n return res === false ? {} : newRequire(res);\n }\n\n function resolve(x) {\n var id = modules[name][1][x];\n return id != null ? id : x;\n }\n }\n\n function Module(moduleName) {\n this.id = moduleName;\n this.bundle = newRequire;\n this.require = nodeRequire;\n this.exports = {};\n }\n\n newRequire.isParcelRequire = true;\n newRequire.Module = Module;\n newRequire.modules = modules;\n newRequire.cache = cache;\n newRequire.parent = previousRequire;\n newRequire.distDir = distDir;\n newRequire.publicUrl = publicUrl;\n newRequire.devServer = devServer;\n newRequire.i = importMap;\n newRequire.register = function (id, exports) {\n modules[id] = [\n function (require, module) {\n module.exports = exports;\n },\n {},\n ];\n };\n\n // Only insert newRequire.load when it is actually used.\n // The code in this file is linted against ES5, so dynamic import is not allowed.\n // INSERT_LOAD_HERE\n\n Object.defineProperty(newRequire, 'root', {\n get: function () {\n return globalObject[parcelRequireName];\n },\n });\n\n globalObject[parcelRequireName] = newRequire;\n\n for (var i = 0; i < entry.length; i++) {\n newRequire(entry[i]);\n }\n\n if (mainEntry) {\n // Expose entry point to Node, AMD or browser globals\n // Based on https://github.com/ForbesLindesay/umd/blob/master/template.js\n var mainExports = newRequire(mainEntry);\n\n // CommonJS\n if (typeof exports === 'object' && typeof module !== 'undefined') {\n module.exports = mainExports;\n\n // RequireJS\n } else if (typeof define === 'function' && define.amd) {\n define(function () {\n return mainExports;\n });\n }\n }\n})({\"f9bsd\":[function(require,module,exports,__globalThis) {\nvar parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\nparcelHelpers.export(exports, \"default\", ()=>artplayerPluginHlsControl);\nvar _audioSvg = require(\"bundle-text:./audio.svg\");\nvar _audioSvgDefault = parcelHelpers.interopDefault(_audioSvg);\nvar _qualitySvg = require(\"bundle-text:./quality.svg\");\nvar _qualitySvgDefault = parcelHelpers.interopDefault(_qualitySvg);\nfunction uniqBy(array, property) {\n const seen = new Map();\n return array.filter((item)=>{\n const key = item[property];\n if (key === undefined) return true;\n return !seen.has(key) && seen.set(key, 1);\n });\n}\nfunction artplayerPluginHlsControl(option = {}) {\n return (art)=>{\n const { $video } = art.template;\n const { errorHandle } = art.constructor.utils;\n function updateQuality(hls) {\n if (!hls.levels.length) return;\n const config = option.quality || {};\n const auto = config.auto || 'Auto';\n const title = config.title || 'Quality';\n const getName = config.getName || ((level)=>level.name || `${level.height}P`);\n const defaultLevel = hls.levels[hls.currentLevel];\n const defaultHtml = defaultLevel ? getName(defaultLevel) : auto;\n const selector = uniqBy(hls.levels.map((item, index)=>{\n return {\n html: getName(item, index),\n value: index,\n default: hls.currentLevel === index\n };\n }), 'html').sort((a, b)=>b.value - a.value);\n selector.push({\n html: auto,\n value: -1,\n default: hls.currentLevel === -1\n });\n const onSelect = (item)=>{\n hls.currentLevel = item.value;\n art.notice.show = `${title}: ${item.html}`;\n if (config.control) art.controls.check(item);\n if (config.setting) art.setting.check(item);\n return item.html;\n };\n if (config.control) art.controls.update({\n name: 'hls-quality',\n position: 'right',\n html: defaultHtml,\n style: {\n padding: '0 10px'\n },\n selector,\n onSelect\n });\n if (config.setting) art.setting.update({\n name: 'hls-quality',\n tooltip: defaultHtml,\n html: title,\n icon: (0, _qualitySvgDefault.default),\n width: 200,\n selector,\n onSelect\n });\n }\n function updateAudio(hls) {\n if (!hls.audioTracks.length) return;\n const config = option.audio || {};\n const auto = config.auto || 'Auto';\n const title = config.title || 'Audio';\n const getName = config.getName || ((track)=>track.name || track.lang || track.language);\n const defaultTrack = hls.audioTracks[hls.audioTrack];\n const defaultHtml = defaultTrack ? getName(defaultTrack) : auto;\n const selector = uniqBy(hls.audioTracks.map((item, index)=>{\n return {\n html: getName(item, index),\n value: item.id,\n default: hls.audioTrack === item.id\n };\n }), 'html');\n const onSelect = (item)=>{\n hls.audioTrack = item.value;\n art.notice.show = `${title}: ${item.html}`;\n if (config.control) art.controls.check(item);\n if (config.setting) art.setting.check(item);\n return item.html;\n };\n if (config.control) art.controls.update({\n name: 'hls-audio',\n position: 'right',\n html: defaultHtml,\n style: {\n padding: '0 10px'\n },\n selector,\n onSelect\n });\n if (config.setting) art.setting.update({\n name: 'hls-audio',\n tooltip: defaultHtml,\n html: title,\n icon: (0, _audioSvgDefault.default),\n width: 200,\n selector,\n onSelect\n });\n }\n function update() {\n errorHandle(art.hls?.media === $video, 'Cannot find instance of HLS from \"art.hls\"');\n updateQuality(art.hls);\n updateAudio(art.hls);\n }\n art.on('ready', update);\n art.on('restart', update);\n return {\n name: 'artplayerPluginHlsControl',\n update\n };\n };\n}\nif (typeof window !== 'undefined') window.artplayerPluginHlsControl = artplayerPluginHlsControl;\n\n},{\"bundle-text:./audio.svg\":\"igHyj\",\"bundle-text:./quality.svg\":\"jhLre\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"5lQoW\"}],\"igHyj\":[function(require,module,exports,__globalThis) {\nmodule.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>\";\n\n},{}],\"jhLre\":[function(require,module,exports,__globalThis) {\nmodule.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>\";\n\n},{}],\"5lQoW\":[function(require,module,exports,__globalThis) {\nexports.interopDefault = function(a) {\n return a && a.__esModule ? a : {\n default: a\n };\n};\nexports.defineInteropFlag = function(a) {\n Object.defineProperty(a, '__esModule', {\n value: true\n });\n};\nexports.exportAll = function(source, dest) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule' || Object.prototype.hasOwnProperty.call(dest, key)) return;\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function() {\n return source[key];\n }\n });\n });\n return dest;\n};\nexports.export = function(dest, destName, get) {\n Object.defineProperty(dest, destName, {\n enumerable: true,\n get: get\n });\n};\n\n},{}]},[\"f9bsd\"], \"f9bsd\", \"parcelRequire4dc0\", {})\nlet {default: _default, } = parcelRequire4dc0(\"f9bsd\");\nexport {_default as default, };\n\n//# sourceMappingURL=index.js.map\n","import $audio from 'bundle-text:./audio.svg'\nimport $quality from 'bundle-text:./quality.svg'\n\nfunction uniqBy(array, property) {\n const seen = new Map()\n return array.filter((item) => {\n const key = item[property]\n if (key === undefined) {\n return true\n }\n return !seen.has(key) && seen.set(key, 1)\n })\n}\n\nexport default function artplayerPluginHlsControl(option = {}) {\n return (art) => {\n const { $video } = art.template\n const { errorHandle } = art.constructor.utils\n\n function updateQuality(hls) {\n if (!hls.levels.length)\n return\n\n const config = option.quality || {}\n const auto = config.auto || 'Auto'\n const title = config.title || 'Quality'\n const getName = config.getName || (level => level.name || `${level.height}P`)\n const defaultLevel = hls.levels[hls.currentLevel]\n const defaultHtml = defaultLevel ? getName(defaultLevel) : auto\n\n const selector = uniqBy(\n hls.levels.map((item, index) => {\n return {\n html: getName(item, index),\n value: index,\n default: hls.currentLevel === index,\n }\n }),\n 'html',\n ).sort((a, b) => b.value - a.value)\n\n selector.push({\n html: auto,\n value: -1,\n default: hls.currentLevel === -1,\n })\n\n const onSelect = (item) => {\n hls.currentLevel = item.value\n art.notice.show = `${title}: ${item.html}`\n if (config.control)\n art.controls.check(item)\n if (config.setting)\n art.setting.check(item)\n return item.html\n }\n\n if (config.control) {\n art.controls.update({\n name: 'hls-quality',\n position: 'right',\n html: defaultHtml,\n style: { padding: '0 10px' },\n selector,\n onSelect,\n })\n }\n\n if (config.setting) {\n art.setting.update({\n name: 'hls-quality',\n tooltip: defaultHtml,\n html: title,\n icon: $quality,\n width: 200,\n selector,\n onSelect,\n })\n }\n }\n\n function updateAudio(hls) {\n if (!hls.audioTracks.length)\n return\n\n const config = option.audio || {}\n const auto = config.auto || 'Auto'\n const title = config.title || 'Audio'\n const getName = config.getName || (track => track.name || track.lang || track.language)\n const defaultTrack = hls.audioTracks[hls.audioTrack]\n const defaultHtml = defaultTrack ? getName(defaultTrack) : auto\n\n const selector = uniqBy(\n hls.audioTracks.map((item, index) => {\n return {\n html: getName(item, index),\n value: item.id,\n default: hls.audioTrack === item.id,\n }\n }),\n 'html',\n )\n\n const onSelect = (item) => {\n hls.audioTrack = item.value\n art.notice.show = `${title}: ${item.html}`\n if (config.control)\n art.controls.check(item)\n if (config.setting)\n art.setting.check(item)\n return item.html\n }\n\n if (config.control) {\n art.controls.update({\n name: 'hls-audio',\n position: 'right',\n html: defaultHtml,\n style: { padding: '0 10px' },\n selector,\n onSelect,\n })\n }\n\n if (config.setting) {\n art.setting.update({\n name: 'hls-audio',\n tooltip: defaultHtml,\n html: title,\n icon: $audio,\n width: 200,\n selector,\n onSelect,\n })\n }\n }\n\n function update() {\n errorHandle(art.hls?.media === $video, 'Cannot find instance of HLS from \"art.hls\"')\n updateQuality(art.hls)\n updateAudio(art.hls)\n }\n\n art.on('ready', update)\n art.on('restart', update)\n\n return {\n name: 'artplayerPluginHlsControl',\n update,\n }\n }\n}\n\nif (typeof window !== 'undefined') {\n window.artplayerPluginHlsControl = artplayerPluginHlsControl\n}\n","module.exports = \"f302549679a988b4\";","module.exports = \"bc6a84b0ae666853\";","exports.interopDefault = function (a) {\n return a && a.__esModule ? a : {default: a};\n};\n\nexports.defineInteropFlag = function (a) {\n Object.defineProperty(a, '__esModule', {value: true});\n};\n\nexports.exportAll = function (source, dest) {\n Object.keys(source).forEach(function (key) {\n if (\n key === 'default' ||\n key === '__esModule' ||\n Object.prototype.hasOwnProperty.call(dest, key)\n ) {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function () {\n return source[key];\n },\n });\n });\n\n return dest;\n};\n\nexports.export = function (dest, destName, get) {\n Object.defineProperty(dest, destName, {\n enumerable: true,\n get: get,\n });\n};\n"],"names":["modules","entry","mainEntry","parcelRequireName","externals","distDir","publicUrl","devServer","globalObject","globalThis","self","window","global","previousRequire","importMap","i","cache","nodeRequire","module","require","bind","newRequire","name","jumped","currentRequire","err","Error","code","localRequire","resolve","x","id","Module","call","exports","res","isParcelRequire","moduleName","bundle","parent","register","Object","defineProperty","get","length","mainExports","define","amd","__globalThis","parcelHelpers","defineInteropFlag","export","artplayerPluginHlsControl","_audioSvg","_audioSvgDefault","interopDefault","_qualitySvg","_qualitySvgDefault","uniqBy","array","property","seen","Map","filter","item","key","undefined","has","set","option","art","$video","template","errorHandle","utils","update","hls","media","updateQuality","levels","config","quality","auto","title","getName","level","height","defaultLevel","currentLevel","defaultHtml","selector","map","index","html","value","default","sort","a","b","push","onSelect","notice","show","control","controls","check","setting","position","style","padding","tooltip","icon","width","updateAudio","audioTracks","audio","track","lang","language","defaultTrack","audioTrack","on","__esModule","exportAll","source","dest","keys","forEach","prototype","hasOwnProperty","enumerable","destName","_default","parcelRequire4dc0"],"version":3,"file":"index.js.map"}