'How to detect whether the camera that is chosen by the user is real or not, within the web browser?

enter image description here

I need to detect whether the camera that is chosen by the user is real or not, in the web browser.

Using JavaScript I can get label and id of the camera but stream.getVideoTracks()[0].label is changeable by the user and stream.getVideoTracks()[0].id is not unique and it also changes session to session.

With a C# app, I think that I can detect that it is real or not by looking at the property PNPDeviceID. For a real camera it is a value like USB\VID... For a fake camera (in my case AlterCam) its value is ROOT\IMAGE\0000.

But in my case I need to detect it within the web browser. How can I achieve this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source