updpdate Progress

This commit is contained in:
dengtongyu committed 2018-05-30 14:53:54 +08:00
1 parent 99484e359e
commit e99cd6d580
2 files changed
+6 -3

No files matched your search

+5 -2
View File
@@ -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}
/>
</div>