Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (21 sloc) 601 Bytes
import React from 'react'
import { MusicMetronome } from '../../src'
export default class Page extends React.Component {
$audio: any = React.createRef()
state = {
showMetronome: false
}
componentDidMount() {
this.setState({ showMetronome: true })
}
render() {
const { showMetronome } = this.state
return (
<>
<h2>音乐节拍器</h2>
<audio src="https://api.bzqll.com/music/netease/url?id=1316375786&key=579621905" autoPlay={true} ref={this.$audio} />
{showMetronome && <MusicMetronome audio={this.$audio.current} />}
</>
)
}
}
You can’t perform that action at this time.