From 68abd28c0adfd5fbf2307980e48d0217526dc235 Mon Sep 17 00:00:00 2001 From: Yanzhen Yu Date: Wed, 1 Apr 2026 12:00:00 +0800 Subject: [PATCH] emit speed with skip event --- src/replay/index.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/replay/index.ts b/src/replay/index.ts index 2a10aa18..581e6075 100644 --- a/src/replay/index.ts +++ b/src/replay/index.ts @@ -205,8 +205,9 @@ export class Replayer { this.applyIncremental(event, isSync); if (event === this.nextUserInteractionEvent) { this.nextUserInteractionEvent = null; - this.setConfig({ speed: this.noramlSpeed }); - this.emitter.emit('skip-end'); + const payload = { speed: this.noramlSpeed }; + this.setConfig(payload); + this.emitter.emit('skip-end', payload); } if (this.config.skipInactive && !this.nextUserInteractionEvent) { for (const _event of this.events) { @@ -227,10 +228,11 @@ export class Replayer { this.noramlSpeed = this.config.speed; const skipTime = this.nextUserInteractionEvent.delay! - event.delay!; - this.setConfig({ + const payload = { speed: Math.round(skipTime / SKIP_TIME_INTERVAL), - }); - this.emitter.emit('skip-start'); + }; + this.setConfig(payload); + this.emitter.emit('skip-start', payload); } } };