Hacker News new | past | comments | ask | show | jobs | submit login

It will use whichever camera the browser has configured as it's default. You may be able to change this in your browser settings



Firstly great app, I enjoyed using this on my baby daughter crawling around the living room! Keep up the good work :)

If you were to implement a camera picker, take a gander at: https://webrtc.github.io/samples/src/content/devices/input-o...

iOS and Android don't have the same camera picker like Chrome on Windows 10, even then it is difficult to always override. I would recommend using enumerateDevices to allow you to pass the deviceId when firing getUserMedia. Not a lot of work. Implemented this a few times for cross-browser WebRTC experiences. A pro-tip is use getUserMedia with audio and video constraints set to true. This forces the permissions pop up to appear. You can kill the feed once the user has accepted the permissions, then ask them what device they want to use, and then fire getUserMedia with the correct deviceId. This is a [nice?] hack as some browsers don't allow you to use enumeratedDevices until after getUserMedia has asked you for the permissions. e.g. Safari...

https://developer.mozilla.org/en-US/docs/Web/API/MediaDevice...




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: