samccone / ivy

57 stars 4 forks source link

Support camera switching 📷 ✋ #3

Open addyosmani opened 8 years ago

addyosmani commented 8 years ago

You want navigator.mediaDevices.enumerateDevices().then(function(e){console.log(e)});

https://webrtc.github.io/samples/src/content/devices/input-output/

Some source you can steal in https://webrtc.github.io/samples/src/content/devices/input-output/js/main.js

Docs: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/enumerateDevices

Old stuff: http://simpl.info/getusermedia/sources/ was deprecated in https://bugs.chromium.org/p/chromium/issues/detail?id=550981 so it's not that.

samccone commented 8 years ago

thanks addddddy

PaulKinlan commented 8 years ago

I do this in qrsnapper.appspot.com, although I need to .migrate to enumerateDevices which is a pain because the new API doesn't tell you the direction of the camera