|
|
@@ -14,6 +14,7 @@ import {
|
|
14
|
14
|
CONFERENCE_LEFT,
|
|
15
|
15
|
CONFERENCE_WILL_JOIN,
|
|
16
|
16
|
CONFERENCE_JOINED,
|
|
|
17
|
+ SET_AUDIO_ONLY,
|
|
17
|
18
|
getCurrentConference
|
|
18
|
19
|
} from '../../base/conference';
|
|
19
|
20
|
import { getInviteURL } from '../../base/connection';
|
|
|
@@ -66,6 +67,9 @@ CallKit && MiddlewareRegistry.register(store => next => action => {
|
|
66
|
67
|
case CONFERENCE_WILL_JOIN:
|
|
67
|
68
|
return _conferenceWillJoin(store, next, action);
|
|
68
|
69
|
|
|
|
70
|
+ case SET_AUDIO_ONLY:
|
|
|
71
|
+ return _setAudioOnly(store, next, action);
|
|
|
72
|
+
|
|
69
|
73
|
case TRACK_ADDED:
|
|
70
|
74
|
case TRACK_REMOVED:
|
|
71
|
75
|
case TRACK_UPDATED:
|
|
|
@@ -247,7 +251,8 @@ function _conferenceWillJoin({ getState }, next, action) {
|
|
247
|
251
|
state['features/base/tracks'],
|
|
248
|
252
|
MEDIA_TYPE.AUDIO);
|
|
249
|
253
|
|
|
250
|
|
- CallKit.updateCall(conference.callUUID, { displayName });
|
|
|
254
|
+ // eslint-disable-next-line object-property-newline
|
|
|
255
|
+ CallKit.updateCall(conference.callUUID, { displayName, hasVideo });
|
|
251
|
256
|
CallKit.setMuted(conference.callUUID, muted);
|
|
252
|
257
|
});
|
|
253
|
258
|
|
|
|
@@ -301,6 +306,40 @@ function _onPerformSetMutedCallAction({ callUUID, muted: newValue }) {
|
|
301
|
306
|
}
|
|
302
|
307
|
}
|
|
303
|
308
|
|
|
|
309
|
+/**
|
|
|
310
|
+ * Update CallKit with the audio only state of the conference. When a conference
|
|
|
311
|
+ * is in audio only mode we will tell CallKit the call has no video. This
|
|
|
312
|
+ * affects how the call is saved in the recent calls list.
|
|
|
313
|
+ *
|
|
|
314
|
+ * XXX: Note that here we are taking the `audioOnly` value straight from the
|
|
|
315
|
+ * action, instead of examining the state. This is intentional, as setting the
|
|
|
316
|
+ * audio only involves multiple actions which will be reflected in the state
|
|
|
317
|
+ * later, but we are just interested in knowing if the mode is going to be
|
|
|
318
|
+ * set or not.
|
|
|
319
|
+ *
|
|
|
320
|
+ * @param {Store} store - The redux store in which the specified {@code action}
|
|
|
321
|
+ * is being dispatched.
|
|
|
322
|
+ * @param {Dispatch} next - The redux {@code dispatch} function to dispatch the
|
|
|
323
|
+ * specified {@code action} in the specified {@code store}.
|
|
|
324
|
+ * @param {Action} action - The redux action which is being dispatched in the
|
|
|
325
|
+ * specified {@code store}.
|
|
|
326
|
+ * @private
|
|
|
327
|
+ * @returns {*} The value returned by {@code next(action)}.
|
|
|
328
|
+ */
|
|
|
329
|
+function _setAudioOnly({ getState }, next, action) {
|
|
|
330
|
+ const result = next(action);
|
|
|
331
|
+ const state = getState();
|
|
|
332
|
+ const conference = getCurrentConference(state);
|
|
|
333
|
+
|
|
|
334
|
+ if (conference && conference.callUUID) {
|
|
|
335
|
+ CallKit.updateCall(
|
|
|
336
|
+ conference.callUUID,
|
|
|
337
|
+ { hasVideo: !action.audioOnly });
|
|
|
338
|
+ }
|
|
|
339
|
+
|
|
|
340
|
+ return result;
|
|
|
341
|
+}
|
|
|
342
|
+
|
|
304
|
343
|
/**
|
|
305
|
344
|
* Notifies the feature callkit that the action
|
|
306
|
345
|
* {@link _SET_CALLKIT_SUBSCRIPTIONS} is being dispatched within a specific
|