diff --git a/components/playbar/index.jsx b/components/playbar/index.jsx index aabcfbd..af76361 100644 --- a/components/playbar/index.jsx +++ b/components/playbar/index.jsx @@ -6,12 +6,19 @@ import { rafThrottle } from '../utilities' @Radium export default class Playbar extends Component { + constructor () { + super() + this.state = { + hover: false, + left: false + } + } shouldComponentUpdate = (nextProps, nextState) => { return shallowCompare(this, nextProps, nextState) } scan = event => { event.preventDefault() - window.player.scan(this.percentage) + window.player.scan(event.clientX / window.innerWidth) } previous = () => { let previous = this.props.player.previous @@ -26,13 +33,20 @@ export default class Playbar extends Component { toggle = () => { window.player.toggle() } + handleMove = event => { + event.preventDefault() + this.setState({left: event.clientX - 4}) + } render () { return (
-
-
+