hiukim / mind-ar-js

Web Augmented Reality. Image Tracking, Face Tracking. Tensorflow.js
MIT License
2.24k stars 417 forks source link

fix: face target camera by a fallback #178

Closed krsbx closed 2 years ago

krsbx commented 2 years ago

at the moment, the face target will use the user camera only and when we try to use it in a laptop/computer, it wont start at all. Need to add a fallback function to use the first camera that the user had.

hiukim commented 2 years ago

@krsbx Is this code change really necessary? I have no problem testing in my laptop. It will starts the environment camera if face camera does not exists.

According to the getUserMedia doc: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia

Search { audio: true, video: { facingMode: "user" } }. It said For example, on mobile devices, the following will prefer the front camera (if one is available) over the rear one:.

It seems to me faceMode: "user" is not a hard constraint, unless we do { audio: true, video: { facingMode: { exact: "user" } } }

krsbx commented 2 years ago

thats weird, lets just close the PR then