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

Method resetPlayer

js/ReadingSystem.js:347–365  ·  view source on GitHub ↗

* 重置播放器

()

Source from the content-addressed store, hash-verified

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 * 更新活跃单元

Callers 1

loadUnitByIndexMethod · 0.95

Calls 3

setPlayButtonDisabledMethod · 0.95
updatePlayButtonMethod · 0.95
setTextFunction · 0.90

Tested by

no test coverage detected