* 切换播放速度
()
| 646 | * 切换播放速度 |
| 647 | */ |
| 648 | cyclePlaybackSpeed() { |
| 649 | const currentIndex = this.state.availableSpeeds.indexOf(this.state.playbackRate); |
| 650 | const nextIndex = (currentIndex + 1) % this.state.availableSpeeds.length; |
| 651 | this.state.playbackRate = this.state.availableSpeeds[nextIndex]; |
| 652 | |
| 653 | if (this.dom.audioPlayer) { |
| 654 | this.dom.audioPlayer.playbackRate = this.state.playbackRate; |
| 655 | } |
| 656 | |
| 657 | this.updateSpeedButton(); |
| 658 | setStorage(this.config.STORAGE_KEYS.PLAYBACK_RATE, this.state.playbackRate); |
| 659 | } |
| 660 | |
| 661 | /** |
| 662 | * 更新倍速按钮显示 |
no test coverage detected