Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 943e6b4

Browse files
authored
Send localDescription, not local variable (#487)
* Send localDescription, not local variable * remove unused vars.
1 parent 4d1cc1f commit 943e6b4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/sdk/p2p/peerconnection-channel.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -846,13 +846,11 @@ class P2PPeerConnectionChannel extends EventDispatcher {
846846
return;
847847
}
848848
this._isNegotiationNeeded = false;
849-
let localDesc;
850849
this._pc.createOffer().then((desc) => {
851850
desc.sdp = this._setRtpReceiverOptions(desc.sdp);
852-
localDesc = desc;
853851
if (this._pc.signalingState === 'stable') {
854852
return this._pc.setLocalDescription(desc).then(() => {
855-
return this._sendSdp(localDesc);
853+
return this._sendSdp(this._pc.localDescription);
856854
});
857855
}
858856
}).catch((e) => {
@@ -866,14 +864,12 @@ class P2PPeerConnectionChannel extends EventDispatcher {
866864
_createAndSendAnswer() {
867865
this._drainPendingStreams();
868866
this._isNegotiationNeeded = false;
869-
let localDesc;
870867
this._pc.createAnswer().then((desc) => {
871868
desc.sdp = this._setRtpReceiverOptions(desc.sdp);
872-
localDesc=desc;
873869
this._logCurrentAndPendingLocalDescription();
874870
return this._pc.setLocalDescription(desc);
875871
}).then(()=>{
876-
return this._sendSdp(localDesc);
872+
return this._sendSdp(this._pc.localDescription);
877873
}).catch((e) => {
878874
Logger.error(e.message + ' Please check your codec settings.');
879875
const error = new ErrorModule.P2PError(ErrorModule.errors.P2P_WEBRTC_SDP,

0 commit comments

Comments
 (0)