|
|
|
|
@ -6,6 +6,7 @@ import faPlay from '@fortawesome/fontawesome-free-solid/faPlay';
|
|
|
|
|
import faChevronLeft from '@fortawesome/fontawesome-free-solid/faChevronLeft';
|
|
|
|
|
import faChevronRight from '@fortawesome/fontawesome-free-solid/faChevronRight';
|
|
|
|
|
import faPause from '@fortawesome/fontawesome-free-solid/faPause';
|
|
|
|
|
import faStepForward from '@fortawesome/fontawesome-free-solid/faStepForward';
|
|
|
|
|
import faWrench from '@fortawesome/fontawesome-free-solid/faWrench';
|
|
|
|
|
import { classes, extension } from 'common/util';
|
|
|
|
|
import { TracerApi } from 'apis';
|
|
|
|
|
@ -116,6 +117,14 @@ class Player extends BaseComponent {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 单步前进:每次点击只推进一帧,不启动自动播放(与 Play 的连续播放相对)。 */
|
|
|
|
|
stepOnce(wrap = true) {
|
|
|
|
|
this.pause();
|
|
|
|
|
if (!this.next() && wrap) {
|
|
|
|
|
this.props.setCursor(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pause() {
|
|
|
|
|
if (this.timer) {
|
|
|
|
|
window.clearTimeout(this.timer);
|
|
|
|
|
@ -162,6 +171,8 @@ class Player extends BaseComponent {
|
|
|
|
|
<Button icon={faPlay} primary onClick={() => this.resume(true)}>Play</Button>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
<Button icon={faStepForward} primary disabled={!chunks.length}
|
|
|
|
|
onClick={() => this.stepOnce(true)}>单步</Button>
|
|
|
|
|
<Button icon={faChevronLeft} primary disabled={!this.isValidCursor(cursor - 1)} onClick={() => this.prev()}/>
|
|
|
|
|
<ProgressBar className={styles.progress_bar} current={cursor} total={chunks.length}
|
|
|
|
|
onChangeProgress={progress => this.handleChangeProgress(progress)}/>
|
|
|
|
|
|