eduardolundgren / tracking.js

A modern approach for Computer Vision on the web
http://trackingjs.com
Other
9.43k stars 1.44k forks source link

How to change default camera? #287

Closed zokanzi closed 6 years ago

zokanzi commented 6 years ago

I want to use different cameras on different pages. I think it's a simple code I can do. For example, can I use a camera with id = 1? I looked a lot but I could not find. Thanks for your helps...

murat-aka commented 6 years ago

Check the last comment on this page

https://groups.google.com/forum/m/#!topic/discuss-webrtc/i07T1X_DY94

Update

https://www.google.co.uk/amp/s/davidwalsh.name/browser-camera/amp

zokanzi commented 6 years ago

Thanks @murat-aka. But I've seen that before. I can get the id of each camera now. But then these id's change when I reopen the page. What I need is an unchanging feature of the camera like deviceId

murat-aka commented 6 years ago

Ok if they change, you need a button on your site to toggle between cameras

zokanzi commented 6 years ago

On one page, views from two cameras will appear and they will appear in the frames. So, the buttons will not be used. I think the devices do not have a permanent id. :( . I will try to get the devices in a loop and solve this problem. Thanks @murat-aka