Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat: show option to join via browser on supported mobile browsers Currently Chromium based browsers and Firefox are supported on Android Only Safari is supported on iOS

Jaya Allamsetty5348fa19c8cb
diff --git a/react/features/base/environment/environment.js b/react/features/base/environment/environment.js
index 6985f7f4f2..c2eca0cf73 100644
--- a/react/features/base/environment/environment.js
+++ b/react/features/base/environment/environment.js
@@ -1,6 +1,7 @@
// @flow
import JitsiMeetJS from '../lib-jitsi-meet';
+import Platform from '../react/Platform';
import { isMobileBrowser } from './utils';
@@ -82,6 +83,18 @@ export function isSupportedBrowser() {
return isMobileBrowser() || JitsiMeetJS.isWebRtcSupported();
}
+/**
+ * Returns whether or not the current environment is a supported
+ * browser on a mobile device.
+ *
+ * @returns {boolean}
+ */
+export function isSupportedMobileBrowser() {
+ return (Platform.OS === 'android' && browser.isChromiumBased())
+ || (Platform.OS === 'android' && browser.isFirefox())
+ || (Platform.OS === 'ios' && browser.isSafari());
+}
+
/**
* Runs various browser checks to know if the current browser is found within
* the list.
diff --git a/react/features/deep-linking/components/DeepLinkingMobilePage.web.js b/react/features/deep-linking/components/DeepLinkingMobilePage.web.js
index ceb23ba4b2..bd60dcecb2 100644
--- a/react/features/deep-linking/components/DeepLinkingMobilePage.web.js
+++ b/react/features/deep-linking/components/DeepLinkingMobilePage.web.js
@@ -1,12 +1,15 @@
// @flow
import React, { Component } from 'react';
+import type { Dispatch } from 'redux';
import { createDeepLinkingPageEvent, sendAnalytics } from '../../analytics';
+import { isSupportedMobileBrowser } from '../../base/environment';
import { translate } from '../../base/i18n';
import { Platform } from '../../base/react';
import { connect } from '../../base/redux';
import { DialInSummary } from '../../invite';
+import { openWebApp } from '../actions';
import { _TNS } from '../constants';
import { generateDeepLinkingURL } from '../functions';
import { renderPromotionalFooter } from '../renderPromotionalFooter';
@@ -37,6 +40,11 @@ type Props = {
*/
_room: string,
+ /**
+ * Used to dispatch actions from the buttons.
+ */
+ dispatch: Dispatch<any>,
+
/**
* The function to translate human-readable text.
*/
@@ -60,6 +68,7 @@ class DeepLinkingMobilePage extends Component<Props> {
// Bind event handlers so they are only bound once per instance.
this._onDownloadApp = this._onDownloadApp.bind(this);
+ this._onLaunchWeb = this._onLaunchWeb.bind(this);
this._onOpenApp = this._onOpenApp.bind(this);
}
@@ -146,6 +155,16 @@ class DeepLinkingMobilePage extends Component<Props> {
{ t(`${_TNS}.downloadApp`) }
</button>
</a>
+ {
+ isSupportedMobileBrowser()
+ && <a
+ onClick = { this._onLaunchWeb }
+ target = '_top'>
+ <button className = { downloadButtonClassName }>
+ { t(`${_TNS}.launchWebButton`) }
+ </button>
+ </a>
+ }
{ renderPromotionalFooter() }
<DialInSummary
className = 'deep-linking-dial-in'
@@ -205,6 +224,20 @@ class DeepLinkingMobilePage extends Component<Props> {
'clicked', 'downloadAppButton', { isMobileBrowser: true }));
}
+ _onLaunchWeb: () => void;
+
+ /**
+ * Handles launch web button clicks.
+ *
+ * @returns {void}
+ */
+ _onLaunchWeb() {
+ sendAnalytics(
+ createDeepLinkingPageEvent(
+ 'clicked', 'launchWebButton', { isMobileBrowser: true }));
+ this.props.dispatch(openWebApp());
+ }
+
_onOpenApp: () => void;
/**
diff --git a/react/features/deep-linking/functions.js b/react/features/deep-linking/functions.js
index 42429c29f1..c9f08f107d 100644
--- a/react/features/deep-linking/functions.js
+++ b/react/features/deep-linking/functions.js
@@ -50,9 +50,10 @@ export function generateDeepLinkingURL() {
*/
export function getDeepLinkingPage(state) {
const { room } = state['features/base/conference'];
+ const { launchInWeb } = state['features/deep-linking'];
// Show only if we are about to join a conference.
- if (!room || state['features/base/config'].disableDeepLinking) {
+ if (launchInWeb || !room || state['features/base/config'].disableDeepLinking) {
return Promise.resolve();
}
@@ -66,13 +67,6 @@ export function getDeepLinkingPage(state) {
? DeepLinkingMobilePage : NoMobileApp);
}
- // desktop
- const { launchInWeb } = state['features/deep-linking'];
-
- if (launchInWeb) {
- return Promise.resolve();
- }
-
return _openDesktopApp(state).then(
// eslint-disable-next-line no-confusing-arrow
result => result ? DeepLinkingDesktopPage : undefined);