sentry icon indicating copy to clipboard operation
sentry copied to clipboard

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

Open michellewzhang opened this issue 9 months ago • 1 comments

Fixes https://github.com/getsentry/sentry/issues/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 wrapperReplayer classes 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 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

WIP: gestures do appear, however scrubbing/seeking causes the gestures to become out of sync with the video. In general, the gestures are not perfectly aligned with the video either. Need to do further work/investigation here to fix these bugs.

michellewzhang avatar Apr 29 '24 20:04 michellewzhang

Bundle Report

Changes will increase total bundle size by 261.05kB :arrow_up:

Bundle name Size Change
app-webpack-bundle-array-push 26.77MB 261.05kB :arrow_up:

codecov[bot] avatar May 06 '24 14:05 codecov[bot]