You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Firefox supports urls on RTCIceServer
There's no longer a need to translate ICE server objects for Firefox, as it supports the `urls` array since version 37.
This commit is contained in:
@@ -1217,24 +1217,9 @@ const _placeCallWithConstraints = function(self, constraints) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const _createPeerConnection = function(self) {
|
const _createPeerConnection = function(self) {
|
||||||
let servers = self.turnServers;
|
|
||||||
if (self.webRtc.vendor === "mozilla") {
|
|
||||||
// modify turnServers struct to match what mozilla expects.
|
|
||||||
servers = [];
|
|
||||||
for (let i = 0; i < self.turnServers.length; i++) {
|
|
||||||
for (let j = 0; j < self.turnServers[i].urls.length; j++) {
|
|
||||||
servers.push({
|
|
||||||
url: self.turnServers[i].urls[j],
|
|
||||||
username: self.turnServers[i].username,
|
|
||||||
credential: self.turnServers[i].credential,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const pc = new self.webRtc.RtcPeerConnection({
|
const pc = new self.webRtc.RtcPeerConnection({
|
||||||
iceTransportPolicy: self.forceTURN ? 'relay' : undefined,
|
iceTransportPolicy: self.forceTURN ? 'relay' : undefined,
|
||||||
iceServers: servers,
|
iceServers: self.turnServers,
|
||||||
});
|
});
|
||||||
pc.oniceconnectionstatechange = hookCallback(self, self._onIceConnectionStateChanged);
|
pc.oniceconnectionstatechange = hookCallback(self, self._onIceConnectionStateChanged);
|
||||||
pc.onsignalingstatechange = hookCallback(self, self._onSignallingStateChanged);
|
pc.onsignalingstatechange = hookCallback(self, self._onSignallingStateChanged);
|
||||||
|
|||||||
Reference in New Issue
Block a user