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

Function init

src/content/getusermedia/exposure/js/main.js:99–107  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

97}
98
99async function init(e) {
100 try {
101 const stream = await navigator.mediaDevices.getUserMedia(constraints);
102 handleSuccess(stream);
103 e.target.disabled = true;
104 } catch (e) {
105 handleError(e);
106 }
107}
108
109document.querySelector('#showVideo').addEventListener('click', e => init(e));

Callers 1

main.jsFile · 0.70

Calls 3

getUserMediaMethod · 0.80
handleSuccessFunction · 0.70
handleErrorFunction · 0.70

Tested by

no test coverage detected