Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(replay): create a wrapper class to init rrweb player alongside video replayer #69927

Merged
merged 12 commits into from
May 8, 2024

Conversation

michellewzhang
Copy link
Member

@michellewzhang michellewzhang commented Apr 29, 2024

Fixes #69817

We have a videoReplayer, which uses video events to create the replay playback for mobile replays. However, in order to see the gestures (clicks, mouse movements, etc) we need to initialize an rrweb player too (the one that web replay uses). This PR introduces a videoReplayerWithInteractions classe which initializes both, so that mobile replays can utilize both players at once.

image

Another key change we had to make was introducing a fake full snapshot event after every meta event in order to trick the rrweb player into thinking we had a node to map the mouse movement to. The rrweb player essentially fails to render any gesture if it doesn't find an element with a matching id to the id inside the positions array (see below picture), so we hardcoded the event to have id: 0 (which is what the SDK is sending for the mobile rrweb events). This workaround should be safe to do since the full snapshot event doesn't affect the video playback at all.

SCR-20240430-nqts

Adding a snapshot event after every meta event also fixes the scrubbing bugs we were experiencing.

Fixing mousetails not showing up involved absolutely positioning the replayer-wrapper.

Screen.Recording.2024-05-08.at.12.03.23.AM.mov

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 29, 2024
Copy link

codecov bot commented May 6, 2024

Bundle Report

Changes will increase total bundle size by 261.05kB ⬆️

Bundle name Size Change
app-webpack-bundle-array-push 26.77MB 261.05kB ⬆️

@michellewzhang michellewzhang changed the title feat(replays): create a wrapper class to init rrweb player alongside video replayer feat(replay): create a wrapper class to init rrweb player alongside video replayer May 6, 2024
@michellewzhang michellewzhang marked this pull request as ready for review May 7, 2024 19:35
@michellewzhang michellewzhang requested a review from a team as a code owner May 7, 2024 19:35
static/app/components/replays/wrapperReplayer.tsx Outdated Show resolved Hide resolved
static/app/components/replays/wrapperReplayer.tsx Outdated Show resolved Hide resolved
static/app/components/replays/wrapperReplayer.tsx Outdated Show resolved Hide resolved
static/app/components/replays/wrapperReplayer.tsx Outdated Show resolved Hide resolved
static/app/components/replays/wrapperReplayer.tsx Outdated Show resolved Hide resolved
@michellewzhang michellewzhang merged commit 6ed338e into master May 8, 2024
41 of 42 checks passed
@michellewzhang michellewzhang deleted the mz/wrapper-class branch May 8, 2024 21:30
@github-actions github-actions bot locked and limited conversation to collaborators May 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Replay Details] Add rrweb player to render gestures
2 participants