From 828792f8639693c57a61a5bb6e29db9f8b0c2cd2 Mon Sep 17 00:00:00 2001 From: Teyut Date: Sat, 16 Aug 2025 02:55:17 +0200 Subject: [PATCH] Explain required attributes FabricImage will not be able to use the video element if the width and height attributes are not set. This is not obvious, so adding a comment about it so people won't waste time figuring out why there code does not work. --- src/content/demo/video-element/code.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/content/demo/video-element/code.js b/src/content/demo/video-element/code.js index 27d9b75c2..e212a4c53 100644 --- a/src/content/demo/video-element/code.js +++ b/src/content/demo/video-element/code.js @@ -7,6 +7,7 @@ const video2source = document.createElement('source'); const webcamEl = document.createElement('video'); +// FabricImage requires the width and height attributes to be set video1El.width = 480; video1El.height = 360; video1El.id = 'video1' @@ -107,4 +108,4 @@ if (window.location.protocol === 'https:') { fabric.util.requestAnimFrame(function render() { canvas.renderAll(); fabric.util.requestAnimFrame(render); -}); \ No newline at end of file +});