updpdate Progress
This commit is contained in:
1 parent
99484e359e
commit
e99cd6d580
2 files changed
+6
-3
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "glass-player",
|
"name": "glass-player",
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"proxy": "https://node.dengtongyu.com",
|
"proxy": "https://node.dengtongyu.com",
|
||||||
"homepage":"/pages/glassplayer/",
|
"homepage":"/pages/glassplayer/",
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ class Progress extends Component {
|
|||||||
|
|
||||||
sliderValue = (time) => {
|
sliderValue = (time) => {
|
||||||
if(time <= 0) return 0;
|
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) => {
|
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);
|
//DataStore.currentTime = Math.floor(value / 100 * DataStore.coutSongMassge.Duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,6 +49,9 @@ class Progress extends Component {
|
|||||||
value={this.sliderValue(DataStore.currentTime)}
|
value={this.sliderValue(DataStore.currentTime)}
|
||||||
disabled={DataStore.disabled}
|
disabled={DataStore.disabled}
|
||||||
tipFormatter={null}
|
tipFormatter={null}
|
||||||
|
step={0.1}
|
||||||
|
min={0}
|
||||||
|
max={100}
|
||||||
onChange={this.onChange}
|
onChange={this.onChange}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in new issue
Block a user