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

Commit

Permalink
Enhance the judgement of sdp semantics.
Browse files Browse the repository at this point in the history
Signed-off-by: Huang Rui1 <[email protected]>
  • Loading branch information
huangrui666 committed Mar 18, 2021
1 parent 1e1834c commit 2598f4d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/sdk/p2p/peerconnection-channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -646,14 +646,22 @@ class P2PPeerConnectionChannel extends EventDispatcher {
const pc = new RTCPeerConnection({
sdpSemantics: 'unified-plan',
});
return (pc.getConfiguration() && pc.getConfiguration().sdpSemantics ===
'plan-b');
if (typeof pc.getConfiguration === "undefined") {
return false;
}
return pc.getConfiguration().sdpSemantics === 'unified-plan';
}

_createPeerConnection() {
const pcConfiguration = this._config.rtcConfiguration || {};
if (Utils.isChrome()) {
pcConfiguration.sdpSemantics = 'unified-plan';
if (this._isUnifiedPlan()) {
Logger.info("Set sdpSemantics: unified-plan");
pcConfiguration.sdpSemantics = 'unified-plan';
} else {
Logger.info("Set sdpSemantics: plan-b");
pcConfiguration.sdpSemantics = 'plan-b';
}
}
this._pc = new RTCPeerConnection(pcConfiguration);
// Firefox 59 implemented addTransceiver. However, mid in SDP will differ from track's ID in this case. And transceiver's mid is null.
Expand Down

0 comments on commit 2598f4d

Please sign in to comment.