tupleblog / face-classification-js

Face classification on JavaScript
https://tupleblog.github.io/face-classification-js/
MIT License
35 stars 5 forks source link

face-classification-js/webcam.html is not working properly #6

Closed bachkukkik closed 5 years ago

bachkukkik commented 5 years ago

Despite camera access being allowed, There is no graphical return on the web browser. @kittinan suspects this is due to the web browser's version.

I tested on Google Chrome Version 71.0.3578.98 (Official Build) (64-bit) and 12.0.2 (14606.3.4). Both can't provide image return.

MacOS 10.14.2 (18C54)

screen shot 2561-12-17 at 10 46 56

kittinan commented 5 years ago

Chrome 71 Remove URL.createObjectURL from MediaStream

https://developers.google.com/web/updates/2018/10/chrome-71-deps-rems

kittinan commented 5 years ago

We using tracking.js to track face from a webcam. I think we fix this issue by we change this line in tracking.js

element.srcObject = stream;

to

try {
  element.srcObject = stream;
} catch (error) {
  element.src = URL.createObjectURL(stream);
}

Ref: https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/srcObject#Supporting_fallback_to_the_src_property

kittinan commented 5 years ago

Working perfectly! direct download tracking.js from the source

bachkukkik commented 5 years ago

Working nicely for me too. Thanks kub @kittinan