Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the warning: "Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true" #55

Open
3 of 7 tasks
pzubar opened this issue Feb 13, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@pzubar
Copy link

pzubar commented Feb 13, 2023

This is not actually a bug, but fixing the warning would be useful (and may optimize the canvas for readback operations)

  • I have verified that the issue occurs with the latest twilio-video-processors.js release and is not marked as a known issue in the CHANGELOG.md.
  • I reviewed the Common Issues and open GitHub issues and verified that this report represents a potentially new issue.
  • I am not sharing any Personally Identifiable Information (PII)
    or sensitive account information (API keys, credentials, etc.) when reporting this issue.

Code to reproduce the issue:

let [{ VirtualBackgroundProcessor }, image] = await Promise.all([
  import('@twilio/video-processors'),
  loadImage(src),
]);
let virtualBackgroundProcessor = new VirtualBackgroundProcessor({
  ...DEFAULT_VIRTUAL_PROCESSOR_OPTIONS,
  backgroundImage: image,
});

videoTrack.addProcessor(virtualBackgroundProcessor);

Expected behavior:

No warning is logged to console.

Actual behavior:

Warning: BackgroundProcessor.js:21 Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently (caused by BackgroundProcessor.js:21) is logged to the console.

Software versions:

  • Browser(s): Chrome v. 110
  • Operating System: macOS 13.2
  • twilio-video-processors.js: ~1.0.2
  • Third-party libraries (e.g., Angular, React, etc.): Ember.js
@pzubar pzubar added the bug Something isn't working label Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant