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(shared-video): Closes confirm dialog if shown on stop. (#15065)

Дамян Минков236434404616
diff --git a/lang/main.json b/lang/main.json
index 401557058d..b3914fc852 100644
--- a/lang/main.json
+++ b/lang/main.json
@@ -441,7 +441,8 @@
"shareScreenWarningTitle": "You need to stop audio sharing before sharing your screen",
"shareVideoConfirmPlay": "You’re about to open an external website. Do you want to continue?",
"shareVideoConfirmPlayTitle": "{{name}} has shared a video with you.",
- "shareVideoLinkError": "Please provide a correct video link.",
+ "shareVideoLinkError": "Oops, this video cannot be played.",
+ "shareVideoLinkStopped": "The video from {{name}} was stopped.",
"shareVideoTitle": "Share video",
"shareYourScreen": "Share your screen",
"shareYourScreenDisabled": "Screen sharing disabled.",
diff --git a/react/features/shared-video/actions.any.ts b/react/features/shared-video/actions.any.ts
index ba0ca210e2..d2a2fcafed 100644
--- a/react/features/shared-video/actions.any.ts
+++ b/react/features/shared-video/actions.any.ts
@@ -1,6 +1,6 @@
import { IStore } from '../app/types';
import { getCurrentConference } from '../base/conference/functions';
-import { openDialog } from '../base/dialog/actions';
+import { hideDialog, openDialog } from '../base/dialog/actions';
import { getLocalParticipant } from '../base/participants/functions';
import {
@@ -187,3 +187,14 @@ export function showConfirmPlayingDialog(actor: String, onSubmit: Function) {
}));
};
}
+
+/**
+ * Hides the video play confirmation dialog.
+ *
+ * @returns {Function}
+ */
+export function hideConfirmPlayingDialog() {
+ return (dispatch: IStore['dispatch']) => {
+ dispatch(hideDialog(ShareVideoConfirmDialog));
+ };
+}
diff --git a/react/features/shared-video/middleware.any.ts b/react/features/shared-video/middleware.any.ts
index d41dec7150..e9358102dc 100644
--- a/react/features/shared-video/middleware.any.ts
+++ b/react/features/shared-video/middleware.any.ts
@@ -12,9 +12,12 @@ import { getLocalParticipant, getParticipantById, getParticipantDisplayName } fr
import { FakeParticipant } from '../base/participants/types';
import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
import { SET_DYNAMIC_BRANDING_DATA } from '../dynamic-branding/actionTypes';
+import { showWarningNotification } from '../notifications/actions';
+import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
import { RESET_SHARED_VIDEO_STATUS, SET_SHARED_VIDEO_STATUS } from './actionTypes';
import {
+ hideConfirmPlayingDialog,
resetSharedVideoStatus,
setAllowedUrlDomians,
setSharedVideoStatus,
@@ -84,6 +87,17 @@ MiddlewareRegistry.register(store => next => action => {
if (sharedVideoStatus === 'stop') {
const videoParticipant = getParticipantById(state, value);
+ if (getState()['features/shared-video'].confirmShowVideo === false) {
+ dispatch(showWarningNotification({
+ titleKey: 'dialog.shareVideoLinkStopped',
+ titleArguments: {
+ name: getParticipantDisplayName(getState(), from)
+ }
+ }, NOTIFICATION_TIMEOUT_TYPE.LONG));
+ }
+
+ dispatch(hideConfirmPlayingDialog());
+
dispatch(participantLeft(value, conference, {
fakeParticipant: videoParticipant?.fakeParticipant
}));