bigbluebutton-Github/bigbluebutton-html5/imports/ui/services/bbb-webrtc-sfu/utils.js
prlanzarin 93b5f4c93d feat(bbb-html5): add a general forceRelay flag
public.media.forceRelay forces relay usage on all browsers, environments and media modules

If true, overrides public.kurento.[4~forceRelayOnFirefox
2021-12-09 11:35:56 +00:00

25 lines
844 B
JavaScript

import browserInfo from '/imports/utils/browserInfo';
import deviceInfo from '/imports/utils/deviceInfo';
const FORCE_RELAY_ON_FF = Meteor.settings.public.kurento.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);
};
export {
shouldForceRelay,
};