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

Method getUserMedia

test/webrtcclient.js:35–55  ·  view source on GitHub ↗
(constraints)

Source from the content-addressed store, hash-verified

33 }
34
35 getUserMedia(constraints) {
36 return this.driver.executeAsyncScript((constraints) => {
37 const callback = arguments[arguments.length - 1];
38 if (!window.localStreams) {
39 window.localStreams = {};
40 }
41
42 return navigator.mediaDevices.getUserMedia(constraints)
43 .then((stream) => {
44 window.localStreams[stream.id] = stream;
45 callback({id: stream.id, tracks: stream.getTracks().map((t) => {
46 return {id: t.id, kind: t.kind};
47 })});
48 }, (e) => callback(e));
49 }, constraints || {audio: true, video: true})
50 .then((streamObj) => {
51 const stream = new MediaStream(streamObj.tracks);
52 stream.id = streamObj.id;
53 return stream;
54 });
55 }
56}
57
58class PeerConnection {

Callers 15

connection.test.jsFile · 0.80
startRecordingFunction · 0.80
initFunction · 0.80
getMediaFunction · 0.80
main.jsFile · 0.80
main.jsFile · 0.80
initFunction · 0.80
startFunction · 0.80
initFunction · 0.80
initFunction · 0.80
main.jsFile · 0.80
startFunction · 0.80

Calls 1

getTracksMethod · 0.95

Tested by

no test coverage detected