(constraints)
| 227 | }; |
| 228 | |
| 229 | function getMedia(constraints) { |
| 230 | if (stream) { |
| 231 | stream.getTracks().forEach(track => { |
| 232 | track.stop(); |
| 233 | }); |
| 234 | } |
| 235 | |
| 236 | clearErrorMessage(); |
| 237 | videoblock.style.display = 'none'; |
| 238 | if (videoSelect.value !== '') { |
| 239 | constraints.video.deviceId = {exact: videoSelect.value}; |
| 240 | } |
| 241 | console.log('getUserMedia constraints: ' + JSON.stringify(constraints)); |
| 242 | navigator.mediaDevices.getUserMedia(constraints) |
| 243 | .then(gotStream, handleError); |
| 244 | } |
no test coverage detected