Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript select audio device

navigator.mediaDevices.getUserMedia(constraints)  .then(function(stream) {    var videoTracks = stream.getVideoTracks();    console.log('Got stream with constraints:', constraints);    console.log('Using video device: ' + videoTracks[0].label);    stream.onended = function() {      console.log('Stream ended');    };    window.stream = stream; // make variable available to console    video.srcObject = stream;  })  .catch(function(error) {    // ...  }
Source by developers.google.com #
 
PREVIOUS NEXT
Tagged: #javascript #select #audio #device
ADD COMMENT
Topic
Name
3+9 =