Skip to content

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

Add CONFERENCE_WILL_JOIN action

Saúl Ibarra Corretgéb1b5f3e6f075
diff --git a/react/features/base/conference/actionTypes.js b/react/features/base/conference/actionTypes.js
index 3dac9614d3..2624c341e2 100644
--- a/react/features/base/conference/actionTypes.js
+++ b/react/features/base/conference/actionTypes.js
@@ -23,6 +23,17 @@ export const CONFERENCE_FAILED = Symbol('CONFERENCE_FAILED');
*/
export const CONFERENCE_JOINED = Symbol('CONFERENCE_JOINED');
+/**
+ * The type of the Redux action which signals that a specific conference will be
+ * joined.
+ *
+ * {
+ * type: CONFERENCE_WILL_JOIN,
+ * room: string
+ * }
+ */
+export const CONFERENCE_WILL_JOIN = Symbol('CONFERENCE_WILL_JOIN');
+
/**
* The type of the Redux action which signals that a specific conference has
* been left.
diff --git a/react/features/base/conference/actions.js b/react/features/base/conference/actions.js
index 4eb5af95f5..39547ee46d 100644
--- a/react/features/base/conference/actions.js
+++ b/react/features/base/conference/actions.js
@@ -12,6 +12,7 @@ import {
CONFERENCE_FAILED,
CONFERENCE_JOINED,
CONFERENCE_LEFT,
+ CONFERENCE_WILL_JOIN,
CONFERENCE_WILL_LEAVE,
LOCK_STATE_CHANGED,
SET_PASSWORD,
@@ -123,6 +124,26 @@ function _conferenceJoined(conference) {
};
}
+/**
+ * Signals the intention of the application to have the local participant leave
+ * a specific conference. Similar in fashion to CONFERENCE_LEFT. Contrary to it
+ * though, it's not guaranteed because CONFERENCE_LEFT may be triggered by
+ * lib-jitsi-meet and not the application.
+ *
+ * @param {string} room - The JitsiConference instance which will
+ * be left by the local participant.
+ * @returns {{
+ * type: CONFERENCE_WILL_JOIN,
+ * room: string
+ * }}
+ */
+function _conferenceWillJoin(room) {
+ return {
+ type: CONFERENCE_WILL_JOIN,
+ room
+ };
+}
+
/**
* Signals that a specific conference has been left.
*
@@ -180,12 +201,15 @@ export function createConference() {
throw new Error('Cannot join conference without room name');
}
+ // XXX Lib-jitsi-meet does not accept uppercase letters.
+ const _room = room.toLowerCase();
+
+ dispatch(_conferenceWillJoin(_room));
+
// TODO Take options from config.
const conference
= connection.initJitsiConference(
-
- // XXX Lib-jitsi-meet does not accept uppercase letters.
- room.toLowerCase(),
+ _room,
{ openSctp: true });
_addConferenceListeners(conference, dispatch);