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

Enhance the judgement of sdp semantics. #475

Open
wants to merge 1 commit into
base: 4.2.x
Choose a base branch
from
Open
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
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