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

Function handleLocalDescription

src/content/datachannel/datatransfer/js/main.js:152–162  ·  view source on GitHub ↗
(desc)

Source from the content-addressed store, hash-verified

150}
151
152async function handleLocalDescription(desc) {
153 pc1.setLocalDescription(desc);
154 console.log('Offer from pc1:\n', desc.sdp);
155 pc2.setRemoteDescription(desc);
156 try {
157 const remoteAnswer = await pc2.createAnswer();
158 handleRemoteAnswer(remoteAnswer);
159 } catch (e) {
160 console.error('Error when creating remote answer: ', e);
161 }
162}
163
164function handleRemoteAnswer(desc) {
165 pc2.setLocalDescription(desc);

Callers 1

createConnectionFunction · 0.85

Calls 5

handleRemoteAnswerFunction · 0.85
setLocalDescriptionMethod · 0.80
setRemoteDescriptionMethod · 0.80
createAnswerMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected