close #153 emit event when it being casted

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent e1d025a1fd
commit d0c31bb4cf
2 changed files with 8 additions and 1 deletions

View File

@@ -131,7 +131,13 @@ export class Replayer {
if (isSync) {
castFn();
} else {
actions.push({ doAction: castFn, delay: this.getDelay(event) });
actions.push({
doAction: () => {
castFn();
this.emitter.emit(ReplayerEvents.EventCast, event);
},
delay: this.getDelay(event),
});
}
}
this.timer.addActions(actions);

View File

@@ -313,4 +313,5 @@ export enum ReplayerEvents {
SkipStart = 'skip-start',
SkipEnd = 'skip-end',
MouseInteraction = 'mouse-interaction',
EventCast = 'event-cast',
}