瀏覽代碼

fix(av-moderation) Display Allow Video instead of Ask to Unmute (#9991)

When the user is allowed audio but not video display Allow Video button instead of Ask to Unmute
master
robertpin 3 年之前
父節點
當前提交
703e43ecd7
No account linked to committer's email address

+ 1
- 0
lang/main.json 查看文件

615
         },
615
         },
616
         "actions": {
616
         "actions": {
617
             "allow": "Allow attendees to:",
617
             "allow": "Allow attendees to:",
618
+            "allowVideo": "Allow video",
618
             "audioModeration": "Unmute themselves",
619
             "audioModeration": "Unmute themselves",
619
             "blockEveryoneMicCamera": "Block everyone's mic and camera",
620
             "blockEveryoneMicCamera": "Block everyone's mic and camera",
620
             "invite": "Invite Someone",
621
             "invite": "Invite Someone",

+ 8
- 2
react/features/av-moderation/actions.js 查看文件

2
 
2
 
3
 import { getConferenceState } from '../base/conference';
3
 import { getConferenceState } from '../base/conference';
4
 import { MEDIA_TYPE, type MediaType } from '../base/media/constants';
4
 import { MEDIA_TYPE, type MediaType } from '../base/media/constants';
5
+import { getParticipantById } from '../base/participants';
6
+import { isForceMuted } from '../participants-pane/functions';
5
 
7
 
6
 import {
8
 import {
7
     DISMISS_PENDING_PARTICIPANT,
9
     DISMISS_PENDING_PARTICIPANT,
27
 export const approveParticipant = (id: string) => (dispatch: Function, getState: Function) => {
29
 export const approveParticipant = (id: string) => (dispatch: Function, getState: Function) => {
28
     const state = getState();
30
     const state = getState();
29
     const { conference } = getConferenceState(state);
31
     const { conference } = getConferenceState(state);
32
+    const participant = getParticipantById(state, id);
30
 
33
 
31
-    if (isEnabledFromState(MEDIA_TYPE.AUDIO, state)) {
34
+    const isAudioForceMuted = isForceMuted(participant, MEDIA_TYPE.AUDIO, state);
35
+    const isVideoForceMuted = isForceMuted(participant, MEDIA_TYPE.VIDEO, state);
36
+
37
+    if (isEnabledFromState(MEDIA_TYPE.AUDIO, state) && isAudioForceMuted) {
32
         conference.avModerationApprove(MEDIA_TYPE.AUDIO, id);
38
         conference.avModerationApprove(MEDIA_TYPE.AUDIO, id);
33
     }
39
     }
34
-    if (isEnabledFromState(MEDIA_TYPE.VIDEO, state)) {
40
+    if (isEnabledFromState(MEDIA_TYPE.VIDEO, state) && isVideoForceMuted) {
35
         conference.avModerationApprove(MEDIA_TYPE.VIDEO, id);
41
         conference.avModerationApprove(MEDIA_TYPE.VIDEO, id);
36
     }
42
     }
37
 };
43
 };

+ 15
- 2
react/features/participants-pane/components/web/MeetingParticipantItem.js 查看文件

2
 
2
 
3
 import React, { useCallback, useEffect, useState } from 'react';
3
 import React, { useCallback, useEffect, useState } from 'react';
4
 
4
 
5
+import { translate } from '../../../base/i18n';
5
 import { JitsiTrackEvents } from '../../../base/lib-jitsi-meet';
6
 import { JitsiTrackEvents } from '../../../base/lib-jitsi-meet';
6
 import { MEDIA_TYPE } from '../../../base/media';
7
 import { MEDIA_TYPE } from '../../../base/media';
7
 import {
8
 import {
135
      */
136
      */
136
     participantID: ?string,
137
     participantID: ?string,
137
 
138
 
139
+    /**
140
+     * The translate function.
141
+     */
142
+    t: Function,
143
+
138
     /**
144
     /**
139
      * The translated "you" text.
145
      * The translated "you" text.
140
      */
146
      */
167
     openDrawerForParticipant,
173
     openDrawerForParticipant,
168
     overflowDrawer,
174
     overflowDrawer,
169
     participantActionEllipsisLabel,
175
     participantActionEllipsisLabel,
176
+    t,
170
     youText
177
     youText
171
 }: Props) {
178
 }: Props) {
172
 
179
 
202
     const audioMediaState = _audioMediaState === MEDIA_STATE.UNMUTED && hasAudioLevels
209
     const audioMediaState = _audioMediaState === MEDIA_STATE.UNMUTED && hasAudioLevels
203
         ? MEDIA_STATE.DOMINANT_SPEAKER : _audioMediaState;
210
         ? MEDIA_STATE.DOMINANT_SPEAKER : _audioMediaState;
204
 
211
 
212
+    let askToUnmuteText = askUnmuteText;
213
+
214
+    if (_audioMediaState !== MEDIA_STATE.FORCE_MUTED && _videoMediaState === MEDIA_STATE.FORCE_MUTED) {
215
+        askToUnmuteText = t('participantsPane.actions.allowVideo');
216
+    }
217
+
205
     return (
218
     return (
206
         <ParticipantItem
219
         <ParticipantItem
207
             actionsTrigger = { ACTION_TRIGGER.HOVER }
220
             actionsTrigger = { ACTION_TRIGGER.HOVER }
221
             {!overflowDrawer && !_participant?.isFakeParticipant
234
             {!overflowDrawer && !_participant?.isFakeParticipant
222
                 && <>
235
                 && <>
223
                     <ParticipantQuickAction
236
                     <ParticipantQuickAction
224
-                        askUnmuteText = { askUnmuteText }
237
+                        askUnmuteText = { askToUnmuteText }
225
                         buttonType = { _quickActionButtonType }
238
                         buttonType = { _quickActionButtonType }
226
                         muteAudio = { muteAudio }
239
                         muteAudio = { muteAudio }
227
                         muteParticipantButtonText = { muteParticipantButtonText }
240
                         muteParticipantButtonText = { muteParticipantButtonText }
280
     };
293
     };
281
 }
294
 }
282
 
295
 
283
-export default connect(_mapStateToProps)(MeetingParticipantItem);
296
+export default translate(connect(_mapStateToProps)(MeetingParticipantItem));

Loading…
取消
儲存