async stopSending(localId) { this._assertSendDirection(); logger.debug('stopSending() [localId:%s]', localId); // Remove the original track from our map and its events. const track = this._mapLocalIdTracks.get(localId); if (!track) throw new Error('associated track not found'); this._mapLocalIdTracks.delete(localId); // Remove the MID from the map. const mid = this._mapLocalIdMid.get(localId); if (!mid) throw new Error('associated MID not found'); this._mapLocalIdMid.delete(localId); await this._channel.request('handler.removeTrack', this._internal, { localId }); this._remoteSdp.disableMediaSection(mid); const offer = await this._channel.request('handler.createOffer', this._internal); logger.debug('stopSending() | calling handler.setLocalDescription() [offer:%o]', offer); await this._channel.request('handler.setLocalDescription', this._internal, offer); const answer = { type: 'answer', sdp: this._remoteSdp.getSdp() }; logger.debug('stopSending() | calling handler.setRemoteDescription() [answer:%o]', answer); await this._channel.request('handler.setRemoteDescription', this._internal, answer); }
async stopReceiving(localId) { this._assertRecvDirection(); logger.debug('stopReceiving() [localId:%s]', localId); // Remove the remote track from the map and make it emit 'ended'. const track = this._mapLocalIdTracks.get(localId); if (!track) throw new Error('associated track not found'); this._mapLocalIdTracks.delete(localId); track.remoteStop(); const mid = this._mapLocalIdMid.get(localId); if (!mid) throw new Error('associated MID not found'); this._remoteSdp.closeMediaSection(mid); const offer = { type: 'offer', sdp: this._remoteSdp.getSdp() }; logger.debug('stopReceiving() | calling handler.setRemoteDescription() [offer:%o]', offer); await this._channel.request('handler.setRemoteDescription', this._internal, offer); const answer = await this._channel.request('handler.createAnswer', this._internal); logger.debug('stopReceiving() | calling handler.setLocalDescription() [answer:%o]', answer); await this._channel.request('handler.setLocalDescription', this._internal, answer); }
await this._channel.request('handler.setLocalDescription', this._internal, offer); this._remoteSdp.sendSctpAssociation({ offerMediaObject }); const answer = { type: 'answer', sdp: this._remoteSdp.getSdp() }; logger.debug('sendDataChannel() | calling handler.setRemoteDescription() [answer:%o]', answer); await this._channel.request('handler.setRemoteDescription', this._internal, answer);
trackId }); const offer = { type: 'offer', sdp: this._remoteSdp.getSdp() }; logger.debug('receive() | calling handler.setRemoteDescription() [offer:%o]', offer); await this._channel.request('handler.setRemoteDescription', this._internal, offer);
const offer = { type: 'offer', sdp: this._remoteSdp.getSdp() }; logger.debug('receiveDataChannel() | calling handler.setRemoteDescription() [offer:%o]', offer); await this._channel.request('handler.setRemoteDescription', this._internal, offer);
}); const answer = { type: 'answer', sdp: this._remoteSdp.getSdp() };
const offer = { type: 'offer', sdp: this._remoteSdp.getSdp() };
const answer = { type: 'answer', sdp: this._remoteSdp.getSdp() };
offer as RTCSessionDescription); const answer = { type: 'answer', sdp: this._remoteSdp.getSdp() };
const offer = { type: 'offer', sdp: this._remoteSdp.getSdp() };
}); const offer = { type: 'offer', sdp: this._remoteSdp.getSdp() };
extmapAllowMixed: false }); const answer = { type: 'answer', sdp: this._remoteSdp.getSdp() }; logger.debug('send() | calling handler.setRemoteDescription() [answer:%o]', answer); await this._channel.request('handler.setRemoteDescription', this._internal, answer);