Check out https://simpl.info/getusermedia/sources/ that shows how you can select sources using
MediaStreamTrack.getSources(gotSources);
You can then select the source and pass it in as optional into getUserMedia
var constraints = {
audio: {
optional: [{sourceId: audioSource}]
},
video: {
optional: [{sourceId: videoSource}]
}
};
navigator.getUserMedia(constraints, successCallback, errorCallback);
It is now fully available in Stable Chrome and mobile (As of v30)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…