Files
ArtPlayer/docs/compiled/artplayer-proxy-canvas.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
20 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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IACN,EAAc,sBAAsB,EACtC,CAyDF,CACF,C,E,iB,C,GA1IwB,EAAA,MAAA,CAAA,EAAA,UAAA,IAAA,GA4IpB,AAAkB,aAAlB,OAAO,QACT,CAAA,OAAO,oBAAoB,CAAG,CADhC,C,E,C,iD,O,E,C,Q,C,S,C,C,C,C,C,C,C,EC5IA,EAAQ,cAAc,CAAG,SAAU,CAAC,EAClC,OAAO,GAAK,EAAE,UAAU,CAAG,EAAI,CAAC,QAAS,CAAC,CAC5C,EAEA,EAAQ,iBAAiB,CAAG,SAAU,CAAC,EACrC,OAAO,cAAc,CAAC,EAAG,aAAc,CAAC,MAAO,CAAA,CAAI,EACrD,EAEA,EAAQ,SAAS,CAAG,SAAU,CAAM,CAAE,CAAI,EAkBxC,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-proxy-canvas/src/index.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})({\"loCXh\":[function(require,module,exports,__globalThis) {\nvar parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\nparcelHelpers.export(exports, \"default\", ()=>artplayerProxyCanvas);\nfunction artplayerProxyCanvas(callback) {\n return (art)=>{\n const { constructor } = art;\n const { createElement } = constructor.utils;\n const canvas = createElement('canvas');\n const video = createElement('video');\n const ctx = canvas.getContext('2d');\n let animationId = null;\n const originalCanvasMethods = {};\n for(const prop in canvas)if (typeof canvas[prop] === 'function') originalCanvasMethods[prop] = canvas[prop].bind(canvas);\n for(const prop in video)if (!(prop in canvas)) Object.defineProperty(canvas, prop, {\n get () {\n const value = video[prop];\n return typeof value === 'function' ? value.bind(video) : value;\n },\n set (value) {\n video[prop] = value;\n },\n configurable: true,\n enumerable: true\n });\n for(const prop in originalCanvasMethods)canvas[prop] = function(...args) {\n if (prop in originalCanvasMethods) return originalCanvasMethods[prop](...args);\n return video[prop](...args);\n };\n setupEventListeners();\n setupArtPlayerEvents();\n return canvas;\n function setupEventListeners() {\n const { events } = constructor.config;\n setTimeout(()=>{\n events.forEach((event)=>{\n art.proxy(video, event, (event)=>{\n art.emit(`video:${event.type}`, event);\n });\n });\n });\n }\n async function draw() {\n try {\n if (typeof createImageBitmap !== 'undefined') {\n const bitmap = await createImageBitmap(video);\n ctx.drawImage(bitmap, 0, 0, canvas.width, canvas.height);\n bitmap.close();\n } else ctx.drawImage(video, 0, 0, canvas.width, canvas.height);\n callback && callback(ctx, video);\n art.emit('artplayerProxyCanvas:draw', ctx, video);\n } catch (error) {\n art.emit('artplayerProxyCanvas:error', error);\n }\n }\n async function animation() {\n await draw();\n animationId = requestAnimationFrame(animation);\n }\n function resize() {\n const player = art.template?.$player;\n if (!player || art.option.autoSize) return;\n const aspectRatio = video.videoWidth / video.videoHeight;\n const containerWidth = player.clientWidth;\n const containerHeight = player.clientHeight;\n const containerRatio = containerWidth / containerHeight;\n let canvasWidth, canvasHeight;\n if (containerRatio > aspectRatio) {\n canvasHeight = containerHeight;\n canvasWidth = canvasHeight * aspectRatio;\n } else {\n canvasWidth = containerWidth;\n canvasHeight = canvasWidth / aspectRatio;\n }\n canvas.width = canvasWidth;\n canvas.height = canvasHeight;\n const paddingLeft = (containerWidth - canvasWidth) / 2;\n const paddingTop = (containerHeight - canvasHeight) / 2;\n Object.assign(canvas.style, {\n padding: `${paddingTop}px ${paddingLeft}px`\n });\n }\n function setupArtPlayerEvents() {\n art.on('video:loadedmetadata', ()=>{\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n });\n art.on('video:play', ()=>{\n cancelAnimationFrame(animationId);\n animation();\n });\n art.on('video:pause', ()=>{\n cancelAnimationFrame(animationId);\n });\n art.on('resize', ()=>{\n resize();\n draw();\n });\n art.on('destroy', ()=>{\n cancelAnimationFrame(animationId);\n });\n }\n };\n}\nif (typeof window !== 'undefined') window.artplayerProxyCanvas = artplayerProxyCanvas;\n\n},{\"@parcel/transformer-js/src/esmodule-helpers.js\":\"5lQoW\"}],\"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},{}]},[\"loCXh\"], \"loCXh\", \"parcelRequire4dc0\", {})\nlet {default: _default, } = parcelRequire4dc0(\"loCXh\");\nexport {_default as default, };\n\n//# sourceMappingURL=index.js.map\n","export default function artplayerProxyCanvas(callback) {\n return (art) => {\n const { constructor } = art\n const { createElement } = constructor.utils\n\n const canvas = createElement('canvas')\n const video = createElement('video')\n const ctx = canvas.getContext('2d')\n\n let animationId = null\n\n const originalCanvasMethods = {}\n for (const prop in canvas) {\n if (typeof canvas[prop] === 'function') {\n originalCanvasMethods[prop] = canvas[prop].bind(canvas)\n }\n }\n\n for (const prop in video) {\n if (!(prop in canvas)) {\n Object.defineProperty(canvas, prop, {\n get() {\n const value = video[prop]\n return typeof value === 'function' ? value.bind(video) : value\n },\n set(value) {\n video[prop] = value\n },\n configurable: true,\n enumerable: true,\n })\n }\n }\n\n for (const prop in originalCanvasMethods) {\n canvas[prop] = function (...args) {\n if (prop in originalCanvasMethods) {\n return originalCanvasMethods[prop](...args)\n }\n return video[prop](...args)\n }\n }\n\n setupEventListeners()\n setupArtPlayerEvents()\n\n return canvas\n\n function setupEventListeners() {\n const { events } = constructor.config\n setTimeout(() => {\n events.forEach((event) => {\n art.proxy(video, event, (event) => {\n art.emit(`video:${event.type}`, event)\n })\n })\n })\n }\n\n async function draw() {\n try {\n if (typeof createImageBitmap !== 'undefined') {\n const bitmap = await createImageBitmap(video)\n ctx.drawImage(bitmap, 0, 0, canvas.width, canvas.height)\n bitmap.close()\n }\n else {\n ctx.drawImage(video, 0, 0, canvas.width, canvas.height)\n }\n callback && callback(ctx, video)\n art.emit('artplayerProxyCanvas:draw', ctx, video)\n }\n catch (error) {\n art.emit('artplayerProxyCanvas:error', error)\n }\n }\n\n async function animation() {\n await draw()\n animationId = requestAnimationFrame(animation)\n }\n\n function resize() {\n const player = art.template?.$player\n if (!player || art.option.autoSize)\n return\n\n const aspectRatio = video.videoWidth / video.videoHeight\n const containerWidth = player.clientWidth\n const containerHeight = player.clientHeight\n const containerRatio = containerWidth / containerHeight\n\n let canvasWidth, canvasHeight\n if (containerRatio > aspectRatio) {\n canvasHeight = containerHeight\n canvasWidth = canvasHeight * aspectRatio\n }\n else {\n canvasWidth = containerWidth\n canvasHeight = canvasWidth / aspectRatio\n }\n\n canvas.width = canvasWidth\n canvas.height = canvasHeight\n\n const paddingLeft = (containerWidth - canvasWidth) / 2\n const paddingTop = (containerHeight - canvasHeight) / 2\n\n Object.assign(canvas.style, {\n padding: `${paddingTop}px ${paddingLeft}px`,\n })\n }\n\n function setupArtPlayerEvents() {\n art.on('video:loadedmetadata', () => {\n canvas.width = video.videoWidth\n canvas.height = video.videoHeight\n })\n\n art.on('video:play', () => {\n cancelAnimationFrame(animationId)\n animation()\n })\n\n art.on('video:pause', () => {\n cancelAnimationFrame(animationId)\n })\n\n art.on('resize', () => {\n resize()\n draw()\n })\n\n art.on('destroy', () => {\n cancelAnimationFrame(animationId)\n })\n }\n }\n}\n\nif (typeof window !== 'undefined') {\n window.artplayerProxyCanvas = artplayerProxyCanvas\n}\n","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","artplayerProxyCanvas","callback","art","constructor","createElement","utils","canvas","video","ctx","getContext","animationId","originalCanvasMethods","prop","value","set","configurable","enumerable","args","setupEventListeners","events","config","setTimeout","forEach","event","proxy","emit","type","on","width","videoWidth","height","videoHeight","cancelAnimationFrame","animation","resize","canvasWidth","canvasHeight","player","template","$player","option","autoSize","aspectRatio","containerWidth","clientWidth","containerHeight","clientHeight","containerRatio","paddingLeft","paddingTop","assign","style","padding","draw","createImageBitmap","bitmap","drawImage","close","error","requestAnimationFrame","defineInteropFlag","export","interopDefault","a","__esModule","default","exportAll","source","dest","keys","key","prototype","hasOwnProperty","destName","_default","parcelRequire4dc0"],"version":3,"file":"index.js.map"}