Amélioration effets sur la camera

This commit is contained in:
2023-01-06 15:43:03 +01:00
parent 10f308c94a
commit 607064913c
4 changed files with 37 additions and 20 deletions

View File

@@ -54,12 +54,15 @@ class CameraEditor {
_frame() {
const context = canvas.getContext("2d");
if (this.width && this.height) {
canvas.width = this.width;
canvas.height = this.height;
context.drawImage(this.video, 0, 0, this.width, this.height);
this._drawEffects();
if(this.streaming) {
if (this.width && this.height) {
canvas.width = this.width;
canvas.height = this.height;
context.drawImage(this.video, 0, 0, this.width, this.height);
this._drawEffects();
}
}
requestAnimationFrame(() => this._frame());
}
_drawEffects() {