Skip to content

Commit

Permalink
Fix: set willReadFrequently attribute for multiple readback operation…
Browse files Browse the repository at this point in the history
…s in scan method.
  • Loading branch information
gianmarco27 authored May 14, 2024
1 parent d4c22f7 commit 53cbd3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/readers/BrowserCodeReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export class BrowserCodeReader {
public static createCanvasFromMediaElement(mediaElement: HTMLVisualMediaElement) {

const canvas = BrowserCodeReader.createCaptureCanvas(mediaElement);
const ctx = canvas.getContext('2d');
const ctx = canvas.getContext('2d', { willReadFrequently: true });

if (!ctx) {
throw new Error('Couldn\'t find Canvas 2D Context.');
Expand Down

0 comments on commit 53cbd3b

Please sign in to comment.