* 更新进度条
()
| 578 | * 更新进度条 |
| 579 | */ |
| 580 | updateProgress() { |
| 581 | if (!this.dom.progressBar || !this.dom.audioPlayer) return; |
| 582 | |
| 583 | if (this.dom.audioPlayer.duration && !this.state.isProgressDragging) { |
| 584 | const percent = (this.dom.audioPlayer.currentTime / this.dom.audioPlayer.duration) * 100; |
| 585 | this.dom.progressBar.style.setProperty('--progress', `${percent}%`); |
| 586 | if (this.dom.currentTime) { |
| 587 | setText(this.dom.currentTime, formatTime(this.dom.audioPlayer.currentTime)); |
| 588 | } |
| 589 | } |
| 590 | } |
| 591 | |
| 592 | /** |
| 593 | * 更新音频时长 |
no test coverage detected