Skip to content

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

Adds confirmation dialog when closing shared video.

damenchoba01733c4f3e
diff --git a/lang/main.json b/lang/main.json
index 12d579de81..5125714df2 100644
--- a/lang/main.json
+++ b/lang/main.json
@@ -163,6 +163,8 @@
"Remove": "Remove",
"shareVideoTitle": "Share a video",
"shareVideoLinkError": "Please provide a correct youtube link.",
+ "removeSharedVideoTitle": "Remove shared video",
+ "removeSharedVideoMsg": "Are you sure you would like to remove your shared video?",
"WaitingForHost": "Waiting for the host ...",
"WaitForHostMsg": "The conference <b>__room__ </b> has not yet started. If you are the host then please authenticate. Otherwise, please wait for the host to arrive.",
"IamHost": "I am the host",
diff --git a/modules/UI/shared_video/SharedVideo.js b/modules/UI/shared_video/SharedVideo.js
index 9ad4b001f9..3812b55afa 100644
--- a/modules/UI/shared_video/SharedVideo.js
+++ b/modules/UI/shared_video/SharedVideo.js
@@ -43,7 +43,8 @@ export default class SharedVideoManager {
return;
}
- this.emitter.emit(UIEvents.UPDATE_SHARED_VIDEO, null, 'stop');
+ proposeToClose().then(() =>
+ this.emitter.emit(UIEvents.UPDATE_SHARED_VIDEO, null, 'stop'));
}
/**
@@ -424,6 +425,30 @@ function getYoutubeLink(url) {
return (url.match(p)) ? RegExp.$1 : false;
}
+/**
+ * Ask user if he want to close shared video.
+ */
+function proposeToClose() {
+ return new Promise(function (resolve, reject) {
+ messageHandler.openTwoButtonDialog(
+ "dialog.removeSharedVideoTitle",
+ null,
+ "dialog.removeSharedVideoMsg",
+ null,
+ false,
+ "dialog.Remove",
+ function(e,v,m,f) {
+ if (v) {
+ resolve();
+ } else {
+ reject();
+ }
+ }
+ );
+
+ });
+}
+
/**
* Ask user for shared video url to share with others.
* Dialog validates client input to allow only youtube urls.