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

Commit fd3b43f

Browse files
committed
Enhance the judgement of sdp semantics.
Signed-off-by: Huang Rui1 <[email protected]>
1 parent 1e1834c commit fd3b43f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/sdk/p2p/peerconnection-channel.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -646,14 +646,23 @@ class P2PPeerConnectionChannel extends EventDispatcher {
646646
const pc = new RTCPeerConnection({
647647
sdpSemantics: 'unified-plan',
648648
});
649+
if (typeof pc.getConfiguration === "undefined") {
650+
return false;
651+
}
649652
return (pc.getConfiguration() && pc.getConfiguration().sdpSemantics ===
650-
'plan-b');
653+
'unified-plan');
651654
}
652655

653656
_createPeerConnection() {
654657
const pcConfiguration = this._config.rtcConfiguration || {};
655658
if (Utils.isChrome()) {
656-
pcConfiguration.sdpSemantics = 'unified-plan';
659+
if (this._isUnifiedPlan()) {
660+
Logger.info("Set sdpSemantics: unified-plan");
661+
pcConfiguration.sdpSemantics = 'unified-plan';
662+
} else {
663+
Logger.info("Set sdpSemantics: plan-b");
664+
pcConfiguration.sdpSemantics = 'plan-b';
665+
}
657666
}
658667
this._pc = new RTCPeerConnection(pcConfiguration);
659668
// Firefox 59 implemented addTransceiver. However, mid in SDP will differ from track's ID in this case. And transceiver's mid is null.

0 commit comments

Comments
 (0)