Rewind and Resolve: A deep dive into building Session Replay for Android
summary
Builds a session replay that captures 1 FPS screenshots, masks sensitive text per line using view layout and compose semantics, and stitches 5‑second segments into MP4 via MediaCodec/MediaMuxer. Uses PixelCopy (API 26) plus Curtains to get the current Window, saves JPEGs at quality 80, and downscales to reduce work; derives image color by drawing into a single‑pixel bitmap. Handles Compose by reading the compose semantics tree, fixes a 16×16 block size video bug, and saves ~35–40% main‑thread time.
AI-written summary · about
chapters (15)
- 0:00Sentry and Session Replay
- 3:38What is Session Replay
- 5:47Building Session Replay
- 6:52Replay video algorithm
- 8:17Efficient screenshots with Pixel Copy
- 13:12Masking sensitive data
- 22:03Masking Jetpack Compose
- 32:54Storing screenshots
- 33:57Video segments from screenshots
- 37:50Video encoding challenges
- 40:21Reducing replay overhead
- 42:28Optimizing view traversal
- 44:35Hybrid SDK support
- 45:20Future plans
- 46:21Q&A
related talks
38mRendering Video: A Detailed Look at Video Playback on Android
19mSolve your Mobile Bugs with Session Replay
23mRewind capture format on IG Stories
43mWhen MediaProjection Isn't Enough
18mAdvanced Android Canvas APIs
40mVideo Processing on Android
29mKeeping your Pixels perfect
01h 28mMastering Screenshot Testing Libraries for Android: A Hands-On Workshop
