Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
feat(unsupported): provide custom blacklist for branding
Leonard Kimcf23045f8d13
diff --git a/react/features/app/getRouteToRender.js b/react/features/app/getRouteToRender.jsindex b897286ecd..02a1d9546d 100644--- a/react/features/app/getRouteToRender.js+++ b/react/features/app/getRouteToRender.js@@ -4,9 +4,8 @@ import { generateRoomWithoutSeparator } from 'js-utils/random';import type { Component } from 'react';import { isRoomValid } from '../base/conference';-import JitsiMeetJS from '../base/lib-jitsi-meet';-import { Platform } from '../base/react';import { toState } from '../base/redux';+import { isSupportedBrowser } from '../base/environment';import { Conference } from '../conference';import { getDeepLinkingPage } from '../deep-linking';import { UnsupportedDesktopBrowser } from '../unsupported-browser';@@ -98,7 +97,7 @@ function _getWebConferenceRoute(state): ?Promise<Route> {.then(deepLinkComponent => {if (deepLinkComponent) {route.component = deepLinkComponent;- } else if (_isSupportedBrowser()) {+ } else if (isSupportedBrowser()) {route.component = Conference;} else {route.component = UnsupportedDesktopBrowser;@@ -118,7 +117,7 @@ function _getWebWelcomePageRoute(state): Promise<Route> {const route = _getEmptyRoute();if (isWelcomePageUserEnabled(state)) {- if (_isSupportedBrowser()) {+ if (isSupportedBrowser()) {route.component = WelcomePage;} else {route.component = UnsupportedDesktopBrowser;@@ -135,25 +134,6 @@ function _getWebWelcomePageRoute(state): Promise<Route> {return Promise.resolve(route);}-/**- * Returns whether or not the current browser should allow the app to display.- *- * @returns {boolean}- */-function _isSupportedBrowser() {- if (navigator.product === 'ReactNative') {- return false;- }-- // We are intentionally allow mobile browsers because:- // - the WelcomePage is mobile ready;- // - if the URL points to a conference, getDeepLinkingPage will take- // care of it.- return Platform.OS === 'android'- || Platform.OS === 'ios'- || JitsiMeetJS.isWebRtcSupported();-}-/*** Returns the default {@code Route}.*diff --git a/react/features/base/environment/environment.js b/react/features/base/environment/environment.jsnew file mode 100644index 0000000000..5f6646c169--- /dev/null+++ b/react/features/base/environment/environment.js@@ -0,0 +1,25 @@+// @flow++import JitsiMeetJS from '../lib-jitsi-meet';+import { Platform } from '../react';++import { isBlacklistedEnvironment } from './isBlacklistedEnvironment';++/**+ * Returns whether or not the current browser should allow the app to display.+ *+ * @returns {boolean}+ */+export function isSupportedBrowser() {+ if (navigator.product === 'ReactNative' || isBlacklistedEnvironment()) {+ return false;+ }++ // We are intentionally allow mobile browsers because:+ // - the WelcomePage is mobile ready;+ // - if the URL points to a conference then deep-linking will take+ // care of it.+ return Platform.OS === 'android'+ || Platform.OS === 'ios'+ || JitsiMeetJS.isWebRtcSupported();+}diff --git a/react/features/base/environment/index.js b/react/features/base/environment/index.jsnew file mode 100644index 0000000000..5d04aebd17--- /dev/null+++ b/react/features/base/environment/index.js@@ -0,0 +1 @@+export * from './environment';diff --git a/react/features/base/environment/isBlacklistedEnvironment.js b/react/features/base/environment/isBlacklistedEnvironment.jsnew file mode 100644index 0000000000..dd873d24f8--- /dev/null+++ b/react/features/base/environment/isBlacklistedEnvironment.js@@ -0,0 +1,11 @@+/**+ * Returns whether or not the current browser is supported for showing meeting+ * based on any custom overrides. This file should be overridden with branding+ * as needed to fit deployment needs.+ *+ * @returns {boolean} True the browser is unsupported due to being blacklisted+ * by the logic within this function.+ */+export function isBlacklistedEnvironment() {+ return false;+}