Skip to content

Commit

Permalink
new quality options
Browse files Browse the repository at this point in the history
  • Loading branch information
billyvg committed Jan 4, 2024
1 parent 0940301 commit 66bc1a3
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/replay/src/canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import type { Integration } from '@sentry/types';
import type { ReplayConfiguration } from './types';

interface ReplayCanvasOptions {
fps: number;
quality: number;
quality: 'low' | 'medium' | 'high';
}

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

private _canvasOptions: ReplayCanvasOptions;

public constructor() {
public constructor(options?: Partial<ReplayCanvasOptions>) {
this.name = ReplayCanvas.id;
// TODO FN: Allow to configure this
// But since we haven't finalized how to configure this, this is predefined for now
// to avoid breaking changes
this._canvasOptions = {
fps: 4,
quality: 0.6,
quality: options && options.quality || 'medium',
};
}

Expand All @@ -47,6 +42,7 @@ export class ReplayCanvas implements Integration {
canvas: {
...this._canvasOptions,
manager: getCanvasManager,
quality: this._canvasOptions.quality,
},
},
};
Expand Down

0 comments on commit 66bc1a3

Please sign in to comment.