MCPcopy
hub / github.com/webrtc/samples / gotStream

Function gotStream

src/content/devices/input-output/js/main.js:100–111  ·  view source on GitHub ↗
(stream)

Source from the content-addressed store, hash-verified

98}
99
100function gotStream(stream) {
101 window.stream = stream; // make stream available to console
102 videoElement.srcObject = stream;
103 if (stream.getVideoTracks()[0]) {
104 openCamera = stream.getVideoTracks()[0].getSettings().deviceId;
105 }
106 if (stream.getAudioTracks()[0]) {
107 openMic = stream.getAudioTracks()[0].getSettings().deviceId;
108 }
109 // Refresh list in case labels have become available
110 return getDevices();
111}
112
113function handleError(error) {
114 console.log('navigator.MediaDevices.getUserMedia error: ', error.message, error.name);

Callers

nothing calls this directly

Calls 3

getDevicesFunction · 0.85
getVideoTracksMethod · 0.80
getAudioTracksMethod · 0.80

Tested by

no test coverage detected