mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-09 20:26:16 -08:00
- 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.
27 lines
667 B
JavaScript
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
|
|
} |