Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/sdk/p2p/peerconnection-channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -846,13 +846,11 @@ class P2PPeerConnectionChannel extends EventDispatcher {
return;
}
this._isNegotiationNeeded = false;
let localDesc;
this._pc.createOffer().then((desc) => {
desc.sdp = this._setRtpReceiverOptions(desc.sdp);
localDesc = desc;
if (this._pc.signalingState === 'stable') {
return this._pc.setLocalDescription(desc).then(() => {
return this._sendSdp(localDesc);
return this._sendSdp(this._pc.localDescription);
});
}
}).catch((e) => {
Expand All @@ -866,14 +864,12 @@ class P2PPeerConnectionChannel extends EventDispatcher {
_createAndSendAnswer() {
this._drainPendingStreams();
this._isNegotiationNeeded = false;
let localDesc;
this._pc.createAnswer().then((desc) => {
desc.sdp = this._setRtpReceiverOptions(desc.sdp);
localDesc=desc;
this._logCurrentAndPendingLocalDescription();
return this._pc.setLocalDescription(desc);
}).then(()=>{
return this._sendSdp(localDesc);
return this._sendSdp(this._pc.localDescription);
}).catch((e) => {
Logger.error(e.message + ' Please check your codec settings.');
const error = new ErrorModule.P2PError(ErrorModule.errors.P2P_WEBRTC_SDP,
Expand Down