mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-16 17:46:17 -08:00
refactor(core): [CORE-20] type entry and converge initialization
This commit is contained in:
1 parent
ccf77c4ed2
commit
ee895a558f
100 files changed
+33854
-839
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import { setStyleText } from '../style/inject'
|
||||
import { isBrowser } from '../utils/compatibility'
|
||||
|
||||
export default function publishBrowserEntry<Constructor extends { version: string, LOG_VERSION: boolean }>(Artplayer: Constructor, style: string): void {
|
||||
if (!isBrowser)
|
||||
return
|
||||
(window as Window & { Artplayer?: Constructor }).Artplayer = Artplayer
|
||||
setStyleText('artplayer-style', style)
|
||||
|
||||
setTimeout(() => {
|
||||
if (Artplayer.LOG_VERSION) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(
|
||||
`%c ArtPlayer %c ${Artplayer.version} %c https://artplayer.org`,
|
||||
'color: #fff; background: #5f5f5f',
|
||||
'color: #fff; background: #4bc729',
|
||||
'',
|
||||
)
|
||||
}
|
||||
}, 100)
|
||||
}
|
||||
Reference in new issue
Block a user