浏览代码

feat: Show cc button for ongoing transcribed meetings for guests

master
damencho 4 年前
父节点
当前提交
20ce38bd4c

+ 6
- 1
react/features/subtitles/components/AbstractClosedCaptionButton.js 查看文件

85
 export function _abstractMapStateToProps(state: Object, ownProps: Object) {
85
 export function _abstractMapStateToProps(state: Object, ownProps: Object) {
86
     const { _requestingSubtitles } = state['features/subtitles'];
86
     const { _requestingSubtitles } = state['features/subtitles'];
87
     const { transcribingEnabled } = state['features/base/config'];
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
     return {
95
     return {
91
         _requestingSubtitles,
96
         _requestingSubtitles,

+ 4
- 6
react/features/subtitles/components/ClosedCaptionButton.native.js 查看文件

31
  * @returns {Props}
31
  * @returns {Props}
32
  */
32
  */
33
 export function mapStateToProps(state: Object, ownProps: Object) {
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
     return {
37
     return {
40
-        ..._abstractMapStateToProps(state, ownProps),
41
-        visible
38
+        ...abstractProps,
39
+        visible: abstractProps.visible && enabled
42
     };
40
     };
43
 }
41
 }
44
 
42
 

正在加载...
取消
保存