Files
rrweb/packages/rrweb-player
xugp ba125e95a6
Some checks failed
ESLint Check / ESLint Check and Report Upload (push) Has been cancelled
ESLint Check / Build Base for Bundle Size Comparison (push) Has been cancelled
Prettier Check / Format Check (push) Has been cancelled
Prettier Check / Format Code (push) Has been cancelled
Tests / Tests (push) Has been cancelled
Fix local rrweb playback flow and add demo page
2026-04-08 16:01:21 +08:00
..
2026-02-03 14:20:05 +01:00
2026-02-13 15:03:23 +01:00

Looking for a Vue.js version? Go here --> @preflight-hq/rrweb-player-vue


rrweb-player

Since rrweb's replayer only provides a basic UI, you can choose rrweb-replayer which is based on rrweb's public APIs but has a feature-rich replayer UI.

How is this different from rrweb.Replayer?

rrweb-player uses rrweb's Replayer under the hood, but as Replayer doesn't include any UI for controls, rrweb-player adds those.

Installation

npm install rrweb-player
import rrwebPlayer from 'rrweb-player';
import 'rrweb-player/dist/style.css';

2) Browser Without Bundler (ESM + import maps)

<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/rrweb-player@latest/dist/style.css"
/>
<script type="importmap">
  {
    "imports": {
      "rrweb-player": "https://cdn.jsdelivr.net/npm/rrweb-player@latest/+esm"
    }
  }
</script>
<script type="module">
  import rrwebPlayer from 'rrweb-player';
</script>

3) Legacy Direct <script> Include (UMD fallback)

Use this only for compatibility with non-module environments.

<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/rrweb-player@latest/dist/style.css"
/>
<script src="https://cdn.jsdelivr.net/npm/rrweb-player@latest/umd/rrweb-player.min.js"></script>

Usage

new rrwebPlayer({
  target: document.body, // customizable root element
  props: {
    events,
  },
});

Options

key default description
events [] the events for replaying
width 1024 the width of the replayer
height 576 the height of the replayer
maxScale 1 the maximum scale of the replayer (1 = 100%), set to 0 for unlimited
autoPlay true whether to autoplay
speed 1 The default speed to play at
speedOption [1, 2, 4, 8] speed options in UI
showController true whether to show the controller UI
tags {} customize the custom events style with a key-value map
inactiveColor #D4D4D4 Customize the color of inactive periods indicator in the progress bar with a valid CSS color string.
... - all the rrweb Replayer options will be bypassed

methods on the rrwebPlayer component

addEventListener(event: string, handler: (params: any) => unknown): void;
addEvent(event: eventWithTime): void;
getMetaData() => {
    startTime: number;
    endTime: number;
    totalTime: number;
}
getReplayer() => Replayer;
getMirror() => Mirror;

Toggles between play/pause

toggle();

Sets speed of player

setSpeed(speed: number)

Turns on/off skip inactive

toggleSkipInactive();

Triggers resize, do this whenever you change width/height

triggerResize();

Plays replay

play();

Pauses replay

pause();

Go to a point in time and pause or play from then

goto(timeOffset: number, play?: boolean)

Plays from a time to a time and (optionally) loop

playRange(
    timeOffset: number,
    endTimeOffset: number,
    startLooping: boolean = false,
    afterHook: undefined | (() => void) = undefined,
  )

Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site.

Gold Sponsors 🥇

sponsor sponsor sponsor sponsor sponsor sponsor sponsor

Silver Sponsors 🥈

sponsor sponsor sponsor sponsor sponsor sponsor sponsor

Bronze Sponsors 🥉

sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor

Backers

Core Team Members


Yuyz0112


Yun Feng


eoghanmurray


Juice10
open for rrweb consulting

Who's using rrweb?

Smart screen recording for SaaS
The first ever UX automation tool Remote Access & Co-Browsing The open source, fullstack Monitoring Platform. Comprehensive data analytics platform that empowers businesses to gain valuable insights and make data-driven decisions.
Intercept, Modify, Record & Replay HTTP Requests. In-app bug reporting & customer feedback platform. Self-hosted website analytics with heatmaps and session recordings. Interactive product demos for small marketing teams