diff --git a/ugj_blocks.js b/ugj_blocks.js index d8df69b..3f3a606 100644 --- a/ugj_blocks.js +++ b/ugj_blocks.js @@ -1407,7 +1407,7 @@ Blockly.Blocks['ugj_face_init'] = { Blockly.JavaScript['ugj_face_init'] = function (block) { var code = [ "const _videoEl = document.getElementById('subdisplay');", - `const _displaySize = { width: videoEl.width, height: videoEl.height };`, + `const _displaySize = { width: _videoEl.width, height: _videoEl.height };`, "const _stream = await navigator.mediaDevices.getUserMedia({ audio: false, video: _displaySize });", "_videoEl.srcObject = _stream;", "" @@ -1516,7 +1516,7 @@ Blockly.Blocks['ugj_face_drawrect'] = { }; Blockly.JavaScript['ugj_face_drawrect'] = function (block) { var code_draw = ` _faceapi.draw.drawDetections(_overlay, _resizedDetections);`; - if (with_landmark) { code_draw += `\n faceapi.draw.drawFaceLandmarks(overlay, resizedDetections);`; } + if (with_landmark) { code_draw += `\n _faceapi.draw.drawFaceLandmarks(_overlay, _resizedDetections);`; } var code = [ ` _faceapi.matchDimensions(_overlay, _displaySize);`, ` const _resizedDetections = _faceapi.resizeResults(_result, _displaySize);`,