Selaa lähdekoodia

feat: Show cc button for ongoing transcribed meetings for guests

master
damencho 4 vuotta sitten
vanhempi
commit
20ce38bd4c

+ 6
- 1
react/features/subtitles/components/AbstractClosedCaptionButton.js Näytä tiedosto

@@ -85,7 +85,12 @@ export class AbstractClosedCaptionButton
85 85
 export function _abstractMapStateToProps(state: Object, ownProps: Object) {
86 86
     const { _requestingSubtitles } = state['features/subtitles'];
87 87
     const { transcribingEnabled } = state['features/base/config'];
88
-    const { visible = Boolean(transcribingEnabled && isLocalParticipantModerator(state)) } = ownProps;
88
+    const { isTranscribing } = state['features/transcribing'];
89
+
90
+    // if the participant is moderator, it can enable transcriptions and if
91
+    // transcriptions are already started for the meeting, guests can just show them
92
+    const { visible = Boolean(transcribingEnabled
93
+        && (isLocalParticipantModerator(state) || isTranscribing)) } = ownProps;
89 94
 
90 95
     return {
91 96
         _requestingSubtitles,

+ 4
- 6
react/features/subtitles/components/ClosedCaptionButton.native.js Näytä tiedosto

@@ -31,14 +31,12 @@ class ClosedCaptionButton
31 31
  * @returns {Props}
32 32
  */
33 33
 export function mapStateToProps(state: Object, ownProps: Object) {
34
-    const { transcribingEnabled } = state['features/base/config'];
35
-    const { isGuest = true } = state['features/base/jwt'];
36
-    const enabled = getFeatureFlag(state, CLOSE_CAPTIONS_ENABLED, true) && transcribingEnabled && !isGuest;
37
-    const { visible = enabled } = ownProps;
34
+    const enabled = getFeatureFlag(state, CLOSE_CAPTIONS_ENABLED, true);
35
+    const abstractProps = _abstractMapStateToProps(state, ownProps);
38 36
 
39 37
     return {
40
-        ..._abstractMapStateToProps(state, ownProps),
41
-        visible
38
+        ...abstractProps,
39
+        visible: abstractProps.visible && enabled
42 40
     };
43 41
 }
44 42
 

Loading…
Peruuta
Tallenna