numgl.js working
by dustinkerstein
HTML
<script src="http://jongomez.github.io/numgl/src/numgl.js"></script>
<video id="video" width="450" height="250" crossorigin="anonymous" controls loop></video>
<button type="button" onclick="numgl.start_pause_button();">Start / Pause</button>
<div>FPS:</div>
<div id="fps"></div>
CSS
video {
//display:none;
}
JavaScript
var x = document.getElementById("video")
x.setAttribute('playsinline', '');
x.muted = true;
//x.src = "http://files.panomoments.com/uhd60fps.mp4";
fetch("http://files.panomoments.com/hd60fps.mp4").then(function(response) {
response.blob().then(function(myBlob) {
x.src = window.URL.createObjectURL(myBlob);
});
});
// Show frames per second.
numgl.set_fps_element("fps");
var videoId = numgl.store_video("video");
numgl.show_canvas(videoId);
numgl.threshold(videoId, 80);
numgl.do_it();