Files
ArtPlayer/scripts/plugin/template/src/index.js
T
Harvey Zhao 1e60637b74 refactor: remove global window assignment for Artplayer and template export
- Removed the assignment of Artplayer to the global window object in index.js of the artplayer package.
- Eliminated the window export for the template plugin in index.js, streamlining the code and reducing global scope pollution.
2026-03-07 20:24:29 +08:00

27 lines
667 B
JavaScript

import style from './style.less?inline';
export default function {{export}}(option) {
return (art) => {
return {
name: '{{export}}',
};
};
}
if (typeof document !== 'undefined') {
const id = 'artplayer-plugin-{{name}}';
let $style = document.getElementById(id)
if (!$style) {
$style = document.createElement('style')
$style.id = id
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', () => {
document.head.appendChild($style)
})
}
else {
(document.head || document.documentElement).appendChild($style)
}
}
$style.textContent = style
}