Skip to content

Commit 1c056d7

Browse files
authored
Explain required attributes (#191)
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.
1 parent 97c4e1e commit 1c056d7

File tree

1 file changed

+2
-1
lines changed
  • src/content/demo/video-element

1 file changed

+2
-1
lines changed

src/content/demo/video-element/code.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const video2source = document.createElement('source');
77

88
const webcamEl = document.createElement('video');
99

10+
// FabricImage requires the width and height attributes to be set
1011
video1El.width = 480;
1112
video1El.height = 360;
1213
video1El.id = 'video1'
@@ -107,4 +108,4 @@ if (window.location.protocol === 'https:') {
107108
fabric.util.requestAnimFrame(function render() {
108109
canvas.renderAll();
109110
fabric.util.requestAnimFrame(render);
110-
});
111+
});

0 commit comments

Comments
 (0)