Following this question How to choose input video device for webrtc?, how can I know which device is currently used by WebRTC? (let's say I just want to display its label in the page)
Asked
Active
Viewed 243 times
1
-
See [this answer](http://stackoverflow.com/a/20082861/1795426) – user11153 Nov 10 '15 at 16:17
-
I saw it, but that allows me to select a device. What I want to know is what device has the user shared (most probably the default one). Or another way to solve it (not as generic) will be to know which is the default device. – Adrian Ber Nov 10 '15 at 16:25
1 Answers
2
The MediaStreamTrack (part of the MediaStream which you get from the getUserMedia success callback; use stream.getTracks()
to get all tracks) has a label
attribute which indicates the name of the device used.

Adrian Ber
- 20,474
- 12
- 67
- 117

Philipp Hancke
- 15,855
- 2
- 23
- 31