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

Method setRemoteDescription

test/webrtcclient.js:112–130  ·  view source on GitHub ↗
(desc)

Source from the content-addressed store, hash-verified

110
111 // TODO: this implicitly creates video elements, is that deseriable?
112 setRemoteDescription(desc) {
113 return this.driver.executeAsyncScript(function(desc) {
114 const callback = arguments[arguments.length - 1];
115
116 pc.ontrack = function(event) {
117 const id = event.streams[0].id;
118 if (document.getElementById('video-' + id)) {
119 return;
120 }
121 const video = document.createElement('video');
122 video.id = 'video-' + id;
123 video.autoplay = true;
124 video.srcObject = event.streams[0];
125 document.body.appendChild(video);
126 };
127 pc.setRemoteDescription(new RTCSessionDescription(desc))
128 .then(callback, callback);
129 }, desc);
130 }
131}
132
133module.exports = {

Callers 15

connection.test.jsFile · 0.80
VideoPipeFunction · 0.80
initLocalOfferMethod · 0.80
initRemoteAnswerMethod · 0.80
handleOfferFunction · 0.80
handleAnswerFunction · 0.80
gotLocalDescriptionFunction · 0.80
gotRemoteDescriptionFunction · 0.80
gotDescription1Function · 0.80
gotDescription2Function · 0.80
handleLocalDescriptionFunction · 0.80
handleRemoteAnswerFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected