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(isEmbedded) limit mobile meetings too

Saúl Ibarra Corretgé0a467f78ee7c
diff --git a/lang/main.json b/lang/main.json
index 74e23f4899..fa4b65cac3 100644
--- a/lang/main.json
+++ b/lang/main.json
@@ -752,7 +752,8 @@
"dataChannelClosedDescriptionWithAudio": "The bridge channel is down and thus disruptions to audio and video may occur.",
"dataChannelClosedWithAudio": "Audio and video quality may be impaired",
"disabledIframe": "Embedding is only meant for demo purposes, so this call will disconnect in {{timeout}} minutes.",
- "disabledIframeSecondary": "Embedding {{domain}} is only meant for demo purposes, so this call will disconnect in {{timeout}} minutes. Please use <a href='{{jaasDomain}}' rel='noopener noreferrer' target='_blank'>Jitsi as a Service</a> for production embedding!",
+ "disabledIframeSecondaryNative": "Embedding {{domain}} is only meant for demo purposes, so this call will disconnect in {{timeout}} minutes.",
+ "disabledIframeSecondaryWeb": "Embedding {{domain}} is only meant for demo purposes, so this call will disconnect in {{timeout}} minutes. Please use <a href='{{jaasDomain}}' rel='noopener noreferrer' target='_blank'>Jitsi as a Service</a> for production embedding!",
"disconnected": "disconnected",
"displayNotifications": "Display notifications for",
"dontRemindMe": "Do not remind me",
diff --git a/react/features/conference/middleware.any.ts b/react/features/conference/middleware.any.ts
index 3e6cf678b2..b77d3388ed 100644
--- a/react/features/conference/middleware.any.ts
+++ b/react/features/conference/middleware.any.ts
@@ -14,6 +14,7 @@ import {
} from '../base/conference/actionTypes';
import { getCurrentConference } from '../base/conference/functions';
import { getDisableLowerHandByModerator } from '../base/config/functions.any';
+import { hangup } from '../base/connection/actions';
import { getURLWithoutParamsNormalized } from '../base/connection/utils';
import { hideDialog } from '../base/dialog/actions';
import { isDialogOpen } from '../base/dialog/functions';
@@ -191,9 +192,7 @@ function _checkIframe(state: IReduxState, dispatch: IStore['dispatch']) {
}
}
- // TODO: enable for mobile too?
- if (isEmbedded() && state['features/base/config'].disableIframeAPI && !browser.isElectron()
- && !browser.isReactNative() && !isVpaasMeeting(state) && !allowIframe) {
+ if (isEmbedded() && state['features/base/config'].disableIframeAPI && !isVpaasMeeting(state) && !allowIframe) {
// show sticky notification and redirect in 5 minutes
const { locationURL } = state['features/base/connection'];
let translationKey = 'notify.disabledIframe';
@@ -208,26 +207,41 @@ function _checkIframe(state: IReduxState, dispatch: IStore['dispatch']) {
const jaasDomain = mapping[hostname];
if (jaasDomain) {
- translationKey = 'notify.disabledIframeSecondary';
+ translationKey = `notify.disabledIframeSecondary${browser.isReactNative() ? 'Native' : 'Web'}`;
domain = hostname;
}
- dispatch(showWarningNotification({
- description: translateToHTML(
- i18next.t.bind(i18next),
- translationKey,
- {
- domain,
- jaasDomain,
- timeout: IFRAME_DISABLED_TIMEOUT_MINUTES
- }
- )
- }, NOTIFICATION_TIMEOUT_TYPE.STICKY));
-
- setTimeout(() => {
- // redirect to the promotional page
- dispatch(redirectToStaticPage('static/close3.html', `#jitsi_meet_external_api_id=${API_ID}`));
- }, IFRAME_DISABLED_TIMEOUT_MINUTES * 60 * 1000);
+ if (browser.isReactNative()) {
+ dispatch(showWarningNotification({
+ description: i18next.t(translationKey,
+ {
+ domain,
+ timeout: IFRAME_DISABLED_TIMEOUT_MINUTES
+ }
+ )
+ }, NOTIFICATION_TIMEOUT_TYPE.STICKY));
+
+ setTimeout(() => {
+ dispatch(hangup());
+ }, IFRAME_DISABLED_TIMEOUT_MINUTES * 60 * 1000);
+ } else {
+ dispatch(showWarningNotification({
+ description: translateToHTML(
+ i18next.t.bind(i18next),
+ translationKey,
+ {
+ domain,
+ jaasDomain,
+ timeout: IFRAME_DISABLED_TIMEOUT_MINUTES
+ }
+ )
+ }, NOTIFICATION_TIMEOUT_TYPE.STICKY));
+
+ setTimeout(() => {
+ // redirect to the promotional page
+ dispatch(redirectToStaticPage('static/close3.html', `#jitsi_meet_external_api_id=${API_ID}`));
+ }, IFRAME_DISABLED_TIMEOUT_MINUTES * 60 * 1000);
+ }
}
}