diff --git a/package.json b/package.json index 1c22271..5d919e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "glass-player", - "version": "0.2.0", + "version": "0.2.1", "private": true, "proxy": "https://node.dengtongyu.com", "homepage":"/pages/glassplayer/", diff --git a/src/components/Progress.js b/src/components/Progress.js index ca51709..9493723 100644 --- a/src/components/Progress.js +++ b/src/components/Progress.js @@ -29,11 +29,11 @@ class Progress extends Component { sliderValue = (time) => { if(time <= 0) return 0; - return Math.floor(time / DataStore.coutSongMassge.Duration * 100); + return Math.floor(time / DataStore.coutSongMassge.Duration * 100 * 10) / 10; } onChange = (value) => { - if(DataStore.audio) DataStore.audio.currentTime = Math.floor(value / 100 * DataStore.coutSongMassge.Duration); + if(DataStore.audio) DataStore.audio.currentTime = Math.floor(value / 100 * DataStore.coutSongMassge.Duration *10) / 10; //DataStore.currentTime = Math.floor(value / 100 * DataStore.coutSongMassge.Duration); } @@ -49,6 +49,9 @@ class Progress extends Component { value={this.sliderValue(DataStore.currentTime)} disabled={DataStore.disabled} tipFormatter={null} + step={0.1} + min={0} + max={100} onChange={this.onChange} />