check meting js

This commit is contained in:
tangly1024.com
2024-04-02 14:49:41 +08:00
parent bb69f30626
commit f3ac44cb06

View File

@@ -19,7 +19,10 @@ const Player = () => {
const musicPlayerEnable = siteConfig('MUSIC_PLAYER')
const musicPlayerCDN = siteConfig('MUSIC_PLAYER_CDN_URL')
const musicMetingEnable = siteConfig('MUSIC_PLAYER_METING')
const musicMetingCDNUrl = siteConfig('MUSIC_PLAYER_METING_CDN_URL', 'https://cdnjs.cloudflare.com/ajax/libs/meting/2.0.1/Meting.min.js')
const musicMetingCDNUrl = siteConfig(
'MUSIC_PLAYER_METING_CDN_URL',
'https://cdnjs.cloudflare.com/ajax/libs/meting/2.0.1/Meting.min.js'
)
const initMusicPlayer = async () => {
if (!musicPlayerEnable) {
@@ -36,14 +39,16 @@ const Player = () => {
}
if (!meting && window.APlayer) {
setPlayer(new window.APlayer({
container: ref.current,
fixed: true,
lrcType: lrcType,
autoplay: autoPlay,
order: order,
audio: audio
}))
setPlayer(
new window.APlayer({
container: ref.current,
fixed: true,
lrcType: lrcType,
autoplay: autoPlay,
order: order,
audio: audio
})
)
}
}
@@ -57,24 +62,28 @@ const Player = () => {
return (
<div className={playerVisible ? 'visible' : 'invisible'}>
<link
rel="stylesheet"
type="text/css"
href="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/aplayer/1.10.1/APlayer.min.css"
rel='stylesheet'
type='text/css'
href='https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/aplayer/1.10.1/APlayer.min.css'
/>
{meting
? <meting-js
fixed="true"
type="playlist"
preload="auto"
lrc-type={siteConfig('MUSIC_PLAYER_METING_LRC_TYPE')}
api={siteConfig('MUSIC_PLAYER_METING_API')}
autoplay={autoPlay}
order={siteConfig('MUSIC_PLAYER_ORDER')}
server={siteConfig('MUSIC_PLAYER_METING_SERVER')}
id={siteConfig('MUSIC_PLAYER_METING_ID')}
/>
: <div ref={ref} data-player={player} />
}
{meting ? (
<meting-js
fixed='true'
type='playlist'
preload='auto'
lrc-type={siteConfig('MUSIC_PLAYER_METING_LRC_TYPE')}
api={siteConfig(
'MUSIC_PLAYER_METING_API',
'https://api.i-meto.com/meting/api'
)}
autoplay={autoPlay}
order={siteConfig('MUSIC_PLAYER_ORDER')}
server={siteConfig('MUSIC_PLAYER_METING_SERVER')}
id={siteConfig('MUSIC_PLAYER_METING_ID')}
/>
) : (
<div ref={ref} data-player={player} />
)}
</div>
)
}