|
@@ -23,8 +23,8 @@ import {
|
23
|
23
|
getRemoteParticipants,
|
24
|
24
|
muteRemoteParticipant
|
25
|
25
|
} from '../base/participants';
|
|
26
|
+import { getIsParticipantAudioMuted } from '../base/tracks';
|
26
|
27
|
import { setKnockingParticipantApproval } from '../lobby/actions';
|
27
|
|
-import { getLobbyState } from '../lobby/functions';
|
28
|
28
|
|
29
|
29
|
declare var APP: Object;
|
30
|
30
|
|
|
@@ -112,12 +112,13 @@ export function muteAllParticipants(exclude: Array<string>, mediaType: MEDIA_TYP
|
112
|
112
|
/**
|
113
|
113
|
* Admit all knocking participants.
|
114
|
114
|
*
|
|
115
|
+ * @param {Array<Object>} knockingParticipants - Array of participants waiting in lobby.
|
|
116
|
+ * @param {boolean} lobbyEnabled - Is lobby mode enabled.
|
|
117
|
+ *
|
115
|
118
|
* @returns {Function}
|
116
|
119
|
*/
|
117
|
|
-export function admitAllKnockingParticipants() {
|
118
|
|
- return (dispatch: Dispatch<any>, getState: Function) => {
|
119
|
|
- const state = getState();
|
120
|
|
- const { knockingParticipants, lobbyEnabled } = getLobbyState(state);
|
|
120
|
+export function admitAllKnockingParticipants(knockingParticipants: Array<Object>, lobbyEnabled: boolean) {
|
|
121
|
+ return (dispatch: Dispatch<any>) => {
|
121
|
122
|
const knockingParticipantsIds = knockingParticipants.map(participant => participant.id);
|
122
|
123
|
|
123
|
124
|
knockingParticipantsIds
|
|
@@ -125,3 +126,19 @@ export function admitAllKnockingParticipants() {
|
125
|
126
|
.map(dispatch);
|
126
|
127
|
};
|
127
|
128
|
}
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+/**
|
|
132
|
+ * Don't allow participants to unmute.
|
|
133
|
+ *
|
|
134
|
+ * @returns {Function}
|
|
135
|
+ */
|
|
136
|
+export function dontAllowUnmute() {
|
|
137
|
+ return (dispatch: Dispatch<any>, getState: Function) => {
|
|
138
|
+ const state = getState();
|
|
139
|
+ const participants = state['features/base/participants'];
|
|
140
|
+
|
|
141
|
+ participants
|
|
142
|
+ .map(p => !getIsParticipantAudioMuted(p) && setAudioMuted(true));
|
|
143
|
+ };
|
|
144
|
+}
|