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 fd3b43f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/sdk/p2p/peerconnection-channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -646,14 +646,23 @@ class P2PPeerConnectionChannel extends EventDispatcher {
const pc = new RTCPeerConnection({
sdpSemantics: 'unified-plan',
});
if (typeof pc.getConfiguration === "undefined") {
return false;
}
return (pc.getConfiguration() && pc.getConfiguration().sdpSemantics ===
'plan-b');
'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 fd3b43f

Please sign in to comment.