Skip to content

Commit eca1728

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 ff5d4c5 commit eca1728

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
@@ -330,6 +330,8 @@ function record<T = eventWithTime>(
330330
blockSelector,
331331
mirror,
332332
sampling: sampling?.canvas?.fps,
333+
clearWebGLBuffer: sampling?.canvas?.clearWebGLBuffer,
334+
initialSnapshotDelay: sampling?.canvas?.initialSnapshotDelay,
333335
dataURLOptions,
334336
resizeFactor: sampling?.canvas?.resizeFactor,
335337
maxSnapshotDimension: sampling?.canvas?.maxSnapshotDimension,

0 commit comments

Comments
 (0)