|
@@ -1970,34 +1970,6 @@ export default class ortcRTCPeerConnection extends yaeti.EventTarget {
|
1970
|
1970
|
this._dtlsTransport = dtlsTransport;
|
1971
|
1971
|
}
|
1972
|
1972
|
|
1973
|
|
- /**
|
1974
|
|
- * Pares STUN and TURN servers to only one. This works around an issue on
|
1975
|
|
- * edge where an error occurs if multiple are declared.
|
1976
|
|
- * See https://developer.microsoft.com/en-us/microsoft-edge/platform
|
1977
|
|
- * /issues/10163458
|
1978
|
|
- *
|
1979
|
|
- * @param {array} servers - All STUN AND TURN servers to connect to.
|
1980
|
|
- * @private
|
1981
|
|
- * @returns {array} An array with only one STUN server and one TURN server
|
1982
|
|
- * at the most.
|
1983
|
|
- */
|
1984
|
|
- _filterServers(servers = []) {
|
1985
|
|
- const filteredServers = [];
|
1986
|
|
- const firstStun = servers.find(server => server.url.startsWith('stun'));
|
1987
|
|
-
|
1988
|
|
- if (firstStun) {
|
1989
|
|
- filteredServers.push(firstStun);
|
1990
|
|
- }
|
1991
|
|
-
|
1992
|
|
- const firstTurn = servers.find(server => server.url.startsWith('turn'));
|
1993
|
|
-
|
1994
|
|
- if (firstTurn) {
|
1995
|
|
- filteredServers.push(firstTurn);
|
1996
|
|
- }
|
1997
|
|
-
|
1998
|
|
- return filteredServers;
|
1999
|
|
- }
|
2000
|
|
-
|
2001
|
1973
|
/**
|
2002
|
1974
|
* Creates the RTCIceGatherer.
|
2003
|
1975
|
* @private
|
|
@@ -2005,7 +1977,7 @@ export default class ortcRTCPeerConnection extends yaeti.EventTarget {
|
2005
|
1977
|
_setIceGatherer(pcConfig) {
|
2006
|
1978
|
const iceGatherOptions = {
|
2007
|
1979
|
gatherPolicy: pcConfig.iceTransportPolicy || 'all',
|
2008
|
|
- iceServers: this._filterServers(pcConfig.iceServers)
|
|
1980
|
+ iceServers: pcConfig.iceServers
|
2009
|
1981
|
};
|
2010
|
1982
|
const iceGatherer = new RTCIceGatherer(iceGatherOptions);
|
2011
|
1983
|
|