MCPcopy Index your code
hub / github.com/iChochy/NCE / updateProgress

Method updateProgress

js/ReadingSystem.js:580–590  ·  view source on GitHub ↗

* 更新进度条

()

Source from the content-addressed store, hash-verified

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 * 更新音频时长

Callers 2

updateDurationMethod · 0.95
bindPlayerControlsMethod · 0.95

Calls 2

setTextFunction · 0.90
formatTimeFunction · 0.90

Tested by

no test coverage detected