* 重置播放器
()
| 345 | * 重置播放器 |
| 346 | */ |
| 347 | resetPlayer() { |
| 348 | this.state.sentence = false; |
| 349 | this.state.currentLyricIndex = -1; |
| 350 | |
| 351 | if (this.dom.audioPlayer) { |
| 352 | this.dom.audioPlayer.pause(); |
| 353 | this.dom.audioPlayer.currentTime = 0; |
| 354 | } |
| 355 | |
| 356 | this.setPlayButtonDisabled(true); |
| 357 | if (this.dom.progressBar) { |
| 358 | this.dom.progressBar.style.setProperty('--progress', '0%'); |
| 359 | } |
| 360 | if (this.dom.currentTime) setText(this.dom.currentTime, '0:00'); |
| 361 | if (this.dom.duration) setText(this.dom.duration, '0:00'); |
| 362 | |
| 363 | this.updatePlayButton(); |
| 364 | this.state.currentLyricIndex = -1; |
| 365 | } |
| 366 | |
| 367 | /** |
| 368 | * 更新活跃单元 |
no test coverage detected