MCPcopy
hub / github.com/iChochy/NCE / cyclePlaybackSpeed

Method cyclePlaybackSpeed

js/ReadingSystem.js:648–659  ·  view source on GitHub ↗

* 切换播放速度

()

Source from the content-addressed store, hash-verified

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 * 更新倍速按钮显示

Callers 1

bindPlayerControlsMethod · 0.95

Calls 2

updateSpeedButtonMethod · 0.95
setStorageFunction · 0.90

Tested by

no test coverage detected