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

Method initLocalOffer

src/content/datachannel/messaging/main.js:56–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54 this._pc2.addEventListener('datachannel', this._onRemoteDataChannel.bind(this));
55
56 const initLocalOffer = async () => {
57 const localOffer = await this._pc1.createOffer();
58 console.log(`Got local offer ${JSON.stringify(localOffer)}`);
59 const localDesc = this._pc1.setLocalDescription(localOffer);
60 const remoteDesc = this._pc2.setRemoteDescription(localOffer);
61 return Promise.all([localDesc, remoteDesc]);
62 };
63
64 const initRemoteAnswer = async () => {
65 const remoteAnswer = await this._pc2.createAnswer();

Callers

nothing calls this directly

Calls 3

createOfferMethod · 0.80
setLocalDescriptionMethod · 0.80
setRemoteDescriptionMethod · 0.80

Tested by

no test coverage detected