File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change 11import { getCanvasManager } from '@sentry-internal/rrweb' ;
22import type { Integration } from '@sentry/types' ;
3- import type { ReplayConfiguration } from './types' ;
3+ import type { CanvasManagerInterface , GetCanvasManagerOptions , ReplayConfiguration } from './types' ;
44
55interface ReplayCanvasOptions {
6- fps : number ;
7- quality : number ;
6+ quality : 'low' | 'medium' | 'high' ;
7+ manualSnapshot ?: boolean ;
88}
99
1010/** An integration to add canvas recording to replay. */
@@ -21,14 +21,14 @@ export class ReplayCanvas implements Integration {
2121
2222 private _canvasOptions : ReplayCanvasOptions ;
2323
24- public constructor ( ) {
24+ public constructor ( options ?: Partial < ReplayCanvasOptions > ) {
2525 this . name = ReplayCanvas . id ;
2626 // TODO FN: Allow to configure this
2727 // But since we haven't finalized how to configure this, this is predefined for now
2828 // to avoid breaking changes
2929 this . _canvasOptions = {
30- fps : 4 ,
31- quality : 0.6 ,
30+ quality : ( options && options . quality ) || 'medium' ,
31+ manualSnapshot : true ,
3232 } ;
3333 }
3434
@@ -46,7 +46,12 @@ export class ReplayCanvas implements Integration {
4646 _experiments : {
4747 canvas : {
4848 ...this . _canvasOptions ,
49- manager : getCanvasManager ,
49+ manager : opts =>
50+ this . canvasManager ( {
51+ ...opts ,
52+ manualSnapshot : this . _canvasOptions . manualSnapshot ,
53+ } ) ,
54+ quality : this . _canvasOptions . quality ,
5055 } ,
5156 } ,
5257 } ;
You can’t perform that action at this time.
0 commit comments