Files
ArtPlayer/docs/compiled/artplayer-plugin-auto-thumbnail.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
14 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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AAG,CACf,GAAG,CAAM,CACT,OAAQ,GACR,OAAA,EACA,MAAA,EACA,MAAA,CACF,CACF,EACF,GAEO,CACL,KAAM,8BACR,EAEJ,C,E,iB,C,GAtBwB,EAAA,MAAA,CAAA,EAAA,UAAA,IAAA,GAwBpB,AAAkB,aAAlB,OAAO,QACT,CAAA,OAAO,4BAA4B,CAAG,CADxC,C,E,C,iD,O,E,C,Q,C,S,C,C,C,C,C,C,C,ECjEA,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-plugin-auto-thumbnail/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})({\"guSFC\":[function(require,module,exports,__globalThis) {\nvar parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\nparcelHelpers.export(exports, \"default\", ()=>artplayerPluginAutoThumbnail);\nfunction create({ url, width, number }, callback) {\n const video = document.createElement('video');\n video.crossOrigin = 'anonymous';\n video.src = url;\n video.onloadedmetadata = ()=>{\n const duration = video.duration;\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n const height = Math.floor(width * video.videoHeight / video.videoWidth);\n canvas.width = width * 10;\n canvas.height = height * Math.ceil(number / 10);\n let blobUrl = null;\n function seekAndDraw(index) {\n canvas.toBlob((blob)=>{\n URL.revokeObjectURL(blobUrl);\n blobUrl = URL.createObjectURL(blob);\n callback({\n url: blobUrl,\n height\n });\n }, 'image/jpeg');\n if (index >= number) return;\n video.currentTime = duration * index / number;\n video.onseeked = ()=>{\n ctx.drawImage(video, index % 10 * width, Math.floor(index / 10) * height, width, height);\n seekAndDraw(index + 1);\n };\n }\n seekAndDraw(0);\n };\n}\nfunction artplayerPluginAutoThumbnail(option) {\n return async (art)=>{\n art.on('video:loadedmetadata', ()=>{\n const url = option.url || art.option.url;\n const width = option.width || 160;\n const number = option.number || 100;\n const scale = option.scale || 1;\n create({\n url,\n width,\n number\n }, (config)=>{\n art.thumbnails = {\n ...config,\n column: 10,\n number,\n width,\n scale\n };\n });\n });\n return {\n name: 'artplayerPluginAutoThumbnail'\n };\n };\n}\nif (typeof window !== 'undefined') window.artplayerPluginAutoThumbnail = artplayerPluginAutoThumbnail;\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},{}]},[\"guSFC\"], \"guSFC\", \"parcelRequire4dc0\", {})\nlet {default: _default, } = parcelRequire4dc0(\"guSFC\");\nexport {_default as default, };\n\n//# sourceMappingURL=index.js.map\n","function create({ url, width, number }, callback) {\n const video = document.createElement('video')\n video.crossOrigin = 'anonymous'\n video.src = url\n\n video.onloadedmetadata = () => {\n const duration = video.duration\n const canvas = document.createElement('canvas')\n const ctx = canvas.getContext('2d')\n const height = Math.floor((width * video.videoHeight) / video.videoWidth)\n\n canvas.width = width * 10\n canvas.height = height * Math.ceil(number / 10)\n\n let blobUrl = null\n\n function seekAndDraw(index) {\n canvas.toBlob((blob) => {\n URL.revokeObjectURL(blobUrl)\n blobUrl = URL.createObjectURL(blob)\n\n callback({\n url: blobUrl,\n height,\n })\n }, 'image/jpeg')\n\n if (index >= number)\n return\n video.currentTime = (duration * index) / number\n\n video.onseeked = () => {\n ctx.drawImage(video, (index % 10) * width, Math.floor(index / 10) * height, width, height)\n seekAndDraw(index + 1)\n }\n }\n\n seekAndDraw(0)\n }\n}\n\nexport default function artplayerPluginAutoThumbnail(option) {\n return async (art) => {\n art.on('video:loadedmetadata', () => {\n const url = option.url || art.option.url\n const width = option.width || 160\n const number = option.number || 100\n const scale = option.scale || 1\n create({ url, width, number }, (config) => {\n art.thumbnails = {\n ...config,\n column: 10,\n number,\n width,\n scale,\n }\n })\n })\n\n return {\n name: 'artplayerPluginAutoThumbnail',\n }\n }\n}\n\nif (typeof window !== 'undefined') {\n window.artplayerPluginAutoThumbnail = artplayerPluginAutoThumbnail\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","artplayerPluginAutoThumbnail","option","art","on","url","width","number","scale","create","callback","video","document","createElement","crossOrigin","src","onloadedmetadata","duration","canvas","ctx","getContext","height","Math","floor","videoHeight","videoWidth","ceil","blobUrl","seekAndDraw","index","toBlob","blob","URL","revokeObjectURL","createObjectURL","currentTime","onseeked","drawImage","config","thumbnails","column","defineInteropFlag","export","interopDefault","a","__esModule","default","value","exportAll","source","dest","keys","forEach","key","prototype","hasOwnProperty","enumerable","destName","_default","parcelRequire4dc0"],"version":3,"file":"index.js.map"}