import React from 'react' import BLOG from '@/blog.config' const Player = () => { const [player, setPlayer] = React.useState() const ref = React.useRef(null) const lrcType = JSON.parse(BLOG.MUSIC_PLAYER_LRC_TYPE) const playerVisible = JSON.parse(BLOG.MUSIC_PLAYER_VISIBLE) const autoPlay = JSON.parse(BLOG.MUSIC_PLAYER_AUTO_PLAY) const meting = JSON.parse(BLOG.MUSIC_PLAYER_METING) React.useEffect(() => { if (!meting && window.APlayer) { setPlayer(new window.APlayer({ container: ref.current, fixed: true, lrcType: lrcType, autoplay: autoPlay, order: BLOG.MUSIC_PLAYER_ORDER, audio: BLOG.MUSIC_PLAYER_AUDIO_LIST })) } return () => { setPlayer(undefined) } }, []) return (
{meting ? :
}
) } export default Player