diff --git a/src/replay/index.ts b/src/replay/index.ts index 8d0230a9..b67c2f4c 100644 --- a/src/replay/index.ts +++ b/src/replay/index.ts @@ -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); diff --git a/src/types.ts b/src/types.ts index 44621399..e1efafa2 100644 --- a/src/types.ts +++ b/src/types.ts @@ -313,4 +313,5 @@ export enum ReplayerEvents { SkipStart = 'skip-start', SkipEnd = 'skip-end', MouseInteraction = 'mouse-interaction', + EventCast = 'event-cast', }