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(toolbox): enable full screen button for ipad browsers

Calin-Teodorff7b6010bdb3
diff --git a/react/features/base/environment/utils.ts b/react/features/base/environment/utils.ts
index b3dec92284..6314180571 100644
--- a/react/features/base/environment/utils.ts
+++ b/react/features/base/environment/utils.ts
@@ -19,3 +19,14 @@ export function isIosMobileBrowser() {
return Platform.OS === 'ios';
}
+/**
+ * Returns whether or not the current environment is an ipad device.
+ *
+ * @returns {boolean}
+ */
+export function isIpadMobileBrowser() {
+
+ // @ts-ignore
+ return isIosMobileBrowser() && Platform.isPad;
+}
+
diff --git a/react/features/base/react/Platform.web.ts b/react/features/base/react/Platform.web.ts
index 17c6e53b46..d67f596762 100644
--- a/react/features/base/react/Platform.web.ts
+++ b/react/features/base/react/Platform.web.ts
@@ -1,11 +1,16 @@
// @ts-ignore
-const { userAgent, maxTouchPoints, platform } = navigator;
-let OS = '';
+const { maxTouchPoints, platform, userAgent } = navigator;
+
+let OS = '',
+ isPad = false;
if (userAgent.match(/Android/i)) {
OS = 'android';
} else if (userAgent.match(/iP(ad|hone|od)/i) || (maxTouchPoints && maxTouchPoints > 2 && /MacIntel/.test(platform))) {
OS = 'ios';
+} else if (userAgent.match(/iP(ad)/i)) {
+ OS = 'ios';
+ isPad = true;
} else if (userAgent.match(/Mac(intosh| OS X)/i)) {
OS = 'macos';
} else if (userAgent.match(/Windows/i)) {
@@ -18,6 +23,13 @@ if (userAgent.match(/Android/i)) {
* Provides a minimal equivalent of react-native's Platform abstraction.
*/
export default {
+ /**
+ * Returns a boolean which defines if device is an iPad.
+ *
+ * @type {boolean}
+ */
+ isPad,
+
/**
* The operating system on which the application is executing.
*
diff --git a/react/features/toolbox/hooks.web.ts b/react/features/toolbox/hooks.web.ts
index 0f06b82e99..b7bc5d146f 100644
--- a/react/features/toolbox/hooks.web.ts
+++ b/react/features/toolbox/hooks.web.ts
@@ -5,7 +5,7 @@ import { ACTION_SHORTCUT_TRIGGERED, createShortcutEvent } from '../analytics/Ana
import { sendAnalytics } from '../analytics/functions';
import { IReduxState } from '../app/types';
import { toggleDialog } from '../base/dialog/actions';
-import { isIosMobileBrowser } from '../base/environment/utils';
+import { isIosMobileBrowser, isIpadMobileBrowser } from '../base/environment/utils';
import { HELP_BUTTON_ENABLED } from '../base/flags/constants';
import { getFeatureFlag } from '../base/flags/functions';
import JitsiMeetJS from '../base/lib-jitsi-meet';
@@ -72,6 +72,7 @@ import VideoSettingsButton from './components/web/VideoSettingsButton';
import { isButtonEnabled, isDesktopShareButtonDisabled } from './functions.web';
import { ICustomToolbarButton, IToolboxButton, ToolbarButton } from './types';
+
const microphone = {
key: 'microphone',
Content: AudioSettingsButton,
@@ -207,7 +208,7 @@ function getDesktopSharingButton() {
* @returns {Object | undefined}
*/
function getFullscreenButton() {
- if (!isIosMobileBrowser()) {
+ if (!isIosMobileBrowser() || isIpadMobileBrowser()) {
return fullscreen;
}
}