Skip to content

Commit 1044586

Browse files
committed
new quality options
1 parent 42d38fc commit 1044586

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

packages/replay/src/canvas.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import type { Integration } from '@sentry/types';
33
import type { ReplayConfiguration } from './types';
44

55
interface ReplayCanvasOptions {
6-
fps: number;
7-
quality: number;
6+
quality: 'low' | 'medium' | 'high';
87
}
98

109
/** An integration to add canvas recording to replay. */
@@ -21,14 +20,10 @@ export class ReplayCanvas implements Integration {
2120

2221
private _canvasOptions: ReplayCanvasOptions;
2322

24-
public constructor() {
23+
public constructor(options?: Partial<ReplayCanvasOptions>) {
2524
this.name = ReplayCanvas.id;
26-
// TODO FN: Allow to configure this
27-
// But since we haven't finalized how to configure this, this is predefined for now
28-
// to avoid breaking changes
2925
this._canvasOptions = {
30-
fps: 4,
31-
quality: 0.6,
26+
quality: options && options.quality || 'medium',
3227
};
3328
}
3429

@@ -47,6 +42,7 @@ export class ReplayCanvas implements Integration {
4742
canvas: {
4843
...this._canvasOptions,
4944
manager: getCanvasManager,
45+
quality: this._canvasOptions.quality,
5046
},
5147
},
5248
};

0 commit comments

Comments
 (0)