As an example, I used simpl.info . In their example, I see "TOSHIBA Web Camera - HD (13d3: 5606)" in the "Video Source" section. Therefore, they can get the label property for sources. I can easily get the sources, but the label is empty:
SourceInfo {facing: "", label: "", kind: "video", id: "0c2c5a2bf359a3ced6d7d39efe2f40477f50d5627df618a6f1998b5142437b27"}
Here is my code:
$(document).ready(function ()
{
if (navigator.getUserMedia)
{
if (typeof MediaStreamTrack.getSources !== 'undefined')
{
MediaStreamTrack.getSources(gotSources);
}
}
});
function gotSources(sourceInfos)
{
for (var i = 0; i < sourceInfos.length; i++)
{
var sourceInfo = sourceInfos[i];
if (sourceInfo.kind == 'video')
{
console.log(sourceInfo);
}
}
}
source
share