fix the skip event calculation (#242)

This commit is contained in:
yz-yu
2026-04-01 12:00:00 +08:00
committed by GitHub
parent ae71cf106a
commit a8b493799b
5 changed files with 67 additions and 20 deletions

View File

@@ -216,10 +216,10 @@ export class Replayer {
* @param timeOffset number
*/
public play(timeOffset = 0) {
if (this.service.state.value == 'ended') {
this.service.send({ type: 'REPLAY'});
if (this.service.state.value === 'ended') {
this.service.send({ type: 'REPLAY' });
}
if (this.service.state.value == 'paused') {
if (this.service.state.value === 'paused') {
this.service.send({ type: 'RESUME', payload: { timeOffset } });
} else {
this.service.send({ type: 'PLAY', payload: { timeOffset } });