import React from 'react' import BLOG from '@/blog.config' const Player = () => { const [player, setPlayer] = React.useState() const ref = React.useRef(null) React.useEffect(() => { if (BLOG.MUSIC_PLAYER && !BLOG.MUSIC_PLAYER_METING) { setPlayer(new window.APlayer({ container: ref.current, fixed: true, showlrc: BLOG.MUSIC_PLAYER_SHOW_LRC, order: BLOG.MUSIC_PLAYER_ORDER, autoplay: BLOG.MUSIC_PLAYER_AUTO_PLAY, audio: BLOG.MUSIC_PLAYER_AUDIO_LIST })) } return () => { setPlayer(undefined) } }, []) return (