basst314 / ngx-webcam

A simple Angular webcam component / pure & minimal, no flash-fallback
https://basst314.github.io/ngx-webcam/?
MIT License
228 stars 104 forks source link

How is deviceId generated #101

Closed tuminzee closed 3 years ago

tuminzee commented 3 years ago

Is the deviceId generated by the library unique to all the devices? Is is dependent on the physical id of the device?

basst314 commented 3 years ago

Hi @tuminzee

The deviceId is not generated by the library. It is returned by the browser API when accessing the webcam stream.

The Mozilla docs make it clear: https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints/deviceId

Device IDs are unique for a given origin, and are guaranteed to be the same across browsing sessions on the same origin.

Hope that helps.

Cheers!

tuminzee commented 3 years ago

Thank you so much :smile: