浏览代码

Add CONFERENCE_WILL_JOIN action

It's fired before creating the conference with lib-jitsi-meet.
j8
Saúl Ibarra Corretgé 8 年前
父节点
当前提交
b1b5f3e6f0
共有 2 个文件被更改,包括 38 次插入3 次删除
  1. 11
    0
      react/features/base/conference/actionTypes.js
  2. 27
    3
      react/features/base/conference/actions.js

+ 11
- 0
react/features/base/conference/actionTypes.js 查看文件

@@ -23,6 +23,17 @@ export const CONFERENCE_FAILED = Symbol('CONFERENCE_FAILED');
23 23
  */
24 24
 export const CONFERENCE_JOINED = Symbol('CONFERENCE_JOINED');
25 25
 
26
+/**
27
+ * The type of the Redux action which signals that a specific conference will be
28
+ * joined.
29
+ *
30
+ * {
31
+ *     type: CONFERENCE_WILL_JOIN,
32
+ *     room: string
33
+ * }
34
+ */
35
+export const CONFERENCE_WILL_JOIN = Symbol('CONFERENCE_WILL_JOIN');
36
+
26 37
 /**
27 38
  * The type of the Redux action which signals that a specific conference has
28 39
  * been left.

+ 27
- 3
react/features/base/conference/actions.js 查看文件

@@ -12,6 +12,7 @@ import {
12 12
     CONFERENCE_FAILED,
13 13
     CONFERENCE_JOINED,
14 14
     CONFERENCE_LEFT,
15
+    CONFERENCE_WILL_JOIN,
15 16
     CONFERENCE_WILL_LEAVE,
16 17
     LOCK_STATE_CHANGED,
17 18
     SET_PASSWORD,
@@ -123,6 +124,26 @@ function _conferenceJoined(conference) {
123 124
     };
124 125
 }
125 126
 
127
+/**
128
+ * Signals the intention of the application to have the local participant leave
129
+ * a specific conference. Similar in fashion to CONFERENCE_LEFT. Contrary to it
130
+ * though, it's not guaranteed because CONFERENCE_LEFT may be triggered by
131
+ * lib-jitsi-meet and not the application.
132
+ *
133
+ * @param {string} room - The JitsiConference instance which will
134
+ * be left by the local participant.
135
+ * @returns {{
136
+ *      type: CONFERENCE_WILL_JOIN,
137
+ *      room: string
138
+ *  }}
139
+ */
140
+function _conferenceWillJoin(room) {
141
+    return {
142
+        type: CONFERENCE_WILL_JOIN,
143
+        room
144
+    };
145
+}
146
+
126 147
 /**
127 148
  * Signals that a specific conference has been left.
128 149
  *
@@ -180,12 +201,15 @@ export function createConference() {
180 201
             throw new Error('Cannot join conference without room name');
181 202
         }
182 203
 
204
+        // XXX Lib-jitsi-meet does not accept uppercase letters.
205
+        const _room = room.toLowerCase();
206
+
207
+        dispatch(_conferenceWillJoin(_room));
208
+
183 209
         // TODO Take options from config.
184 210
         const conference
185 211
             = connection.initJitsiConference(
186
-
187
-                    // XXX Lib-jitsi-meet does not accept uppercase letters.
188
-                    room.toLowerCase(),
212
+                    _room,
189 213
                     { openSctp: true });
190 214
 
191 215
         _addConferenceListeners(conference, dispatch);

正在加载...
取消
保存