(constraints, isGetDisplayMedia)
| 177 | } |
| 178 | |
| 179 | async function init(constraints, isGetDisplayMedia) { |
| 180 | try { |
| 181 | const stream = isGetDisplayMedia ? |
| 182 | await navigator.mediaDevices.getDisplayMedia(constraints) : |
| 183 | await navigator.mediaDevices.getUserMedia(constraints); |
| 184 | handleSuccess(stream); |
| 185 | } catch (e) { |
| 186 | console.error('Source open error:', e); |
| 187 | errorMsgElement.innerHTML = `Source error: ${e.toString()}`; |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | async function onStart(isGetDisplayMedia) { |
| 192 | document.querySelector('button#start-gum').disabled = true; |
no test coverage detected