File tree Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change 11import { createCanvasManager } from '@sentry-internal/rrweb' ;
22import type { Integration } from '@sentry/types' ;
33import type { CanvasManagerInterface , GetCanvasManagerOptions , ReplayConfiguration } from './types' ;
4+ import { CANVAS_QUALITY } from './constants' ;
45
56interface ReplayCanvasOptions {
67 quality : 'low' | 'medium' | 'high' ;
@@ -60,14 +61,14 @@ export class ReplayCanvas implements Integration {
6061 * Take manual snapshot of canvas
6162 */
6263 public snapshotCanvas ( canvasElement ?: HTMLCanvasElement ) : void {
63- const canvasManager : CanvasManagerInterface = createCanvasManager ( this . canvasManager , {
64+ const canvasManager : CanvasManagerInterface = createCanvasManager ( {
6465 recordCanvas : true ,
6566 blockClass : '' ,
6667 blockSelector : null ,
6768 unblockSelector : null ,
68- dataURLOptions : this . _canvasOptions . quality ,
69+ dataURLOptions : CANVAS_QUALITY [ this . _canvasOptions . quality ] . dataURLOptions ,
6970 } ) ;
7071
71- return canvasManager . snapshot ( this . _canvasOptions , canvasElement ) ;
72+ return canvasManager . snapshot ( canvasElement ) ;
7273 }
7374}
Original file line number Diff line number Diff line change @@ -51,14 +51,7 @@ export interface CanvasManagerInterface {
5151 unfreeze ( ) : void ;
5252 lock ( ) : void ;
5353 unlock ( ) : void ;
54- snapshot (
55- dataURLOptions : Partial < {
56- type : string ;
57- quality : number ;
58- } > ,
59- sampling : number ,
60- canvasElement ?: HTMLCanvasElement ,
61- ) : void ;
54+ snapshot ( canvasElement ?: HTMLCanvasElement ) : void ;
6255}
6356
6457export interface GetCanvasManagerOptions {
You can’t perform that action at this time.
0 commit comments