2.29.0 • Published 22 days ago

@sentry-internal/rrweb-player v2.29.0

Weekly downloads
-
License
MIT
Repository
github
Last release
22 days ago

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

rrweb-player can also be included with <script>

<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/dist/index.js"></script>

Or installed by using NPM:

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

Usage

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

Options

keydefaultdescription
events[]the events for replaying
width1024the width of the replayer
height576the height of the replayer
maxScale1the maximum scale of the replayer (1 = 100%), set to 0 for unlimited
autoPlaytruewhether to autoplay
speed1The default speed to play at
speedOption1, 2, 4, 8speed options in UI
showControllertruewhether to show the controller UI
tags{}customize the custom events style with a key-value map
inactiveColor#D4D4D4Customize 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,
  )
2.29.0

22 days ago

2.25.0

5 months ago

2.27.0

2 months ago

2.19.0

5 months ago

2.17.0

6 months ago

2.20.0

5 months ago

2.22.0

5 months ago

2.28.0

2 months ago

2.24.0

5 months ago

2.26.0

3 months ago

2.18.0

6 months ago

2.21.0

5 months ago

2.23.0

5 months ago

2.16.0

7 months ago

2.15.0

7 months ago

2.14.0

7 months ago

2.13.0

7 months ago

2.12.0

8 months ago

2.11.0

10 months ago

2.10.0

10 months ago

2.9.0

10 months ago

2.8.0

11 months ago

2.7.2

11 months ago

2.7.3

11 months ago

2.7.0

11 months ago

2.6.0

11 months ago

2.5.0

12 months ago

2.4.0

12 months ago

2.0.0-beta11.0

1 year ago

2.3.0

1 year ago

2.2.0

1 year ago

2.1.1

1 year ago

2.1.0

1 year ago

2.0.1

1 year ago

2.0.0-alpha10.0

1 year ago

2.0.0

1 year ago

2.0.0-alpha10.1

1 year ago

1.108.0

2 years ago

1.106.0

2 years ago

1.107.0

2 years ago

1.101.0

2 years ago

1.104.0

2 years ago

1.105.0

2 years ago

1.104.1

2 years ago

1.102.0

2 years ago

1.101.1

2 years ago

1.100.2

2 years ago

1.103.0

2 years ago

1.101.2

2 years ago

1.100.1

2 years ago