From 62ae0b4aa0d5617ad6df00d8565f230210bf8d32 Mon Sep 17 00:00:00 2001 From: wjsc Date: Sun, 18 Feb 2018 20:09:40 -0300 Subject: [PATCH] Mobile autoplay bug fixed --- src/components/Player/Player.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Player/Player.js b/src/components/Player/Player.js index c70c985..2b9602d 100644 --- a/src/components/Player/Player.js +++ b/src/components/Player/Player.js @@ -33,6 +33,8 @@ class Player extends React.Component { ); this.trackCurrentTrack(this.props.state.tracks[this.props.state.current]); }; + this.element.load(); + this.element.play(); } componentWillUnmount() { this.element.ontimeupdate = false; @@ -47,7 +49,7 @@ class Player extends React.Component { nextProps.state.status !== this.props.state.status && (nextProps.state.status === 'play' ? this.element.play() : this.element.pause()); } renderAudio(currentTrack){ - return ; + return ; } render() { const currentTrack = this.props.state.tracks[this.props.state.current];