Deprecated API
This answer uses a non-standard API with limited browser support. It works in current Chrome at the time of writing, but will not be accepted in future versions of other browsers and may go away in Chrome. For a solution with wider support see: fooobar.com/questions/1600704 / ...
Using MediaStreamTrack.getSources() , you can get a list of available sources. Each source has a kind property, as well as a label .
MediaStreamTrack.getSources(function(sourceInfos) { for (var i = 0; i != sourceInfos.length; ++i) { var thisSource = sourceInfos[i]; console.log('stream type: '+thisSource.kind+', label: '+thisSource.label);
Documentation and Related
source share