improve error handling and logging

This commit is contained in:
Ruben van de Ven 2020-09-28 12:17:32 +02:00
parent 27b4eea796
commit f1a60d4dee
1 changed files with 7 additions and 7 deletions

View File

@ -1,6 +1,6 @@
console.log('p5 version:', p5);
console.log('ml5 version:', ml5);
console.log(location.origin);
// console.log('p5 version:', p5);
// console.log('ml5 version:', ml5);
// console.log(location.origin);
let assets = {};
@ -20,7 +20,7 @@ var draw = function () {
try {
drawMask(transformed);
} catch (error) {
console.exception(error);
console.error(error);
}
pop();
@ -146,7 +146,7 @@ function setup() {
video = createCapture(constraints);
lastFrame = createGraphics(video.width, video.height);
console.log(video);
// console.log(video);
// HeadGazeSetup(video);
// video.size(width, height);
video.hide(); // Hide the video element, and just show the canvas
@ -169,7 +169,7 @@ var handleResults = function(){
gotResults = function(err, result) {
if (err) {
console.log(err)
console.error(err)
return
}
@ -179,7 +179,7 @@ gotResults = function(err, result) {
// size of video becomes known only after camera approval
if(lastFrame.width != video.width || lastFrame.height != video.height){
console.log('Resizing canvas');
// console.log('Resizing canvas');
lastFrame.resizeCanvas(video.width, video.height);
}