JSFiddle - React, Tailwind, and code Playground
HTML
<video id="webcam" width="640" height="480"></video>
<button type="button" onclick="numglGlobalVar.start_pause_button();">Start / Pause</button>
<div>FPS:</div>
<div id="fps"></div>
CSS
video {
display:none;
}
JavaScript
let numglGlobalVar;
fetch("https://raw.githubusercontent.com/jongomez/numgl/master/src/numgl.js")
.then((response) => response.text())
.then((text) => {
eval(text);
numglGlobalVar = numgl;
// Show frames per second.
numgl.set_fps_element("fps");
var webcamId = numgl.store_webcam("webcam");
numgl.show_canvas(webcamId);
numgl.threshold(webcamId, 80);
numgl.do_it();
});