bigbluebutton-Github/bigbluebutton-html5/imports/ui/services/bbb-webrtc-sfu/utils.js
Daniel Schreiber 4347ff2e3b Re-add option to disable enforce relay webrtc traffic for Firefox
There may be other bridges may not need to force relay traffic on
firefox as @prlanzarin pointed out. So set the default to a
configuration that works out of the box but leave other choices for the
operator.

The option is moved from kurento namespace to media next to the general
forceRelay option.
2023-01-03 23:21:25 +01:00

26 lines
930 B
JavaScript

import browserInfo from '/imports/utils/browserInfo';
import deviceInfo from '/imports/utils/deviceInfo';
import { hasTurnServer } from '/imports/utils/fetchStunTurnServers';
const FORCE_RELAY_ON_FF = Meteor.settings.public.media.forceRelayOnFirefox;
const FORCE_RELAY = Meteor.settings.public.media.forceRelay;
/*
* Whether TURN/relay usage should be forced to work around Firefox's lack of
* support for regular nomination when dealing with ICE-litee peers (e.g.:
* mediasoup). See: https://bugzilla.mozilla.org/show_bug.cgi?id=1034964
*
* iOS endpoints are ignored from the trigger because _all_ iOS browsers
* are either native WebKit or WKWebView based (so they shouldn't be affected)
*/
const shouldForceRelay = () => {
const { isFirefox } = browserInfo;
const { isIos } = deviceInfo;
return FORCE_RELAY || ((isFirefox && !isIos) && FORCE_RELAY_ON_FF && hasTurnServer());
};
export {
shouldForceRelay,
};