Skip to content

Commit d7ececd

Browse files
committed
fix recording of webgl2 canvases (#106)
webgl2 canvases created after highlight would start recording with the `preserveDrawingBuffer: false` setting would not record correctly because we would snapshot a transparent image of the canvas. instead of trying to clear the canvas, we should create a context with `preserveDrawingBuffer: true` to ensure that the canvas can be recorded (tested in babylon.js) https://app.highlight.io/1/sessions/n7P0x5XTItCqEN7B7pmtJVldUzJo
1 parent f2ec2ef commit d7ececd

File tree

5 files changed

+218
-141
lines changed

5 files changed

+218
-141
lines changed

packages/rrweb/src/record/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,8 @@ function record<T = eventWithTime>(
331331
blockSelector,
332332
mirror,
333333
sampling: sampling?.canvas?.fps,
334+
clearWebGLBuffer: sampling?.canvas?.clearWebGLBuffer,
335+
initialSnapshotDelay: sampling?.canvas?.initialSnapshotDelay,
334336
dataURLOptions,
335337
resizeFactor: sampling?.canvas?.resizeFactor,
336338
maxSnapshotDimension: sampling?.canvas?.maxSnapshotDimension,

0 commit comments

Comments
 (0)