diff --git a/src/replay/index.ts b/src/replay/index.ts index 719b17a6..556cfcbf 100644 --- a/src/replay/index.ts +++ b/src/replay/index.ts @@ -130,6 +130,7 @@ export class Replayer { } const defaultConfig: playerConfig = { speed: 1, + maxSpeed: 360, root: document.body, loadTimeout: 0, skipInactive: false, @@ -492,7 +493,10 @@ export class Replayer { const skipTime = this.nextUserInteractionEvent.delay! - event.delay!; const payload = { - speed: Math.min(Math.round(skipTime / SKIP_TIME_INTERVAL), 360), + speed: Math.min( + Math.round(skipTime / SKIP_TIME_INTERVAL), + this.config.maxSpeed, + ), }; this.speedService.send({ type: 'FAST_FORWARD', payload }); this.emitter.emit(ReplayerEvents.SkipStart, payload); diff --git a/src/types.ts b/src/types.ts index 432e29a6..d5122579 100644 --- a/src/types.ts +++ b/src/types.ts @@ -487,6 +487,7 @@ export type hookResetter = () => void; export type playerConfig = { speed: number; + maxSpeed: number; root: Element; loadTimeout: number; skipInactive: boolean;