瀏覽代碼

settings: enable settings buttons on permission grant

Some CSS fixes are also included.
master
vp8x8 5 年之前
父節點
當前提交
84714ba3bd
沒有連結到貢獻者的電子郵件帳戶。

+ 5
- 0
css/_audio-preview.css 查看文件

13
         padding: 16px;
13
         padding: 16px;
14
 
14
 
15
         &-icon {
15
         &-icon {
16
+            color: #A4B8D1;
16
             display: inline-block;
17
             display: inline-block;
17
         }
18
         }
18
 
19
 
66
             .audio-preview-test-button {
67
             .audio-preview-test-button {
67
                 display: inline-block;
68
                 display: inline-block;
68
             }
69
             }
70
+
71
+            .audio-preview-entry-text {
72
+                max-width: 196px;
73
+            }
69
         }
74
         }
70
 
75
 
71
         .audio-preview-entry-text {
76
         .audio-preview-entry-text {

+ 1
- 0
css/_video-preview.css 查看文件

1
 .video-preview {
1
 .video-preview {
2
+    background: none;
2
     max-height: 290px;
3
     max-height: 290px;
3
     overflow: auto;
4
     overflow: auto;
4
 
5
 

+ 10
- 0
react/features/overlay/functions.js 查看文件

21
 
21
 
22
     return undefined;
22
     return undefined;
23
 }
23
 }
24
+
25
+/**
26
+ * Returns the visibility of the media permissions prompt.
27
+ *
28
+ * @param {Object} state - The Redux state.
29
+ * @returns {boolean}
30
+ */
31
+export function getMediaPermissionPromptVisibility(state: Object) {
32
+    return state['features/overlay'].isMediaPermissionPromptVisible;
33
+}

+ 6
- 2
react/features/settings/actionTypes.js 查看文件

1
-// The type of (redux) action which sets the visibility of the audio settings popup.
1
+/**
2
+ * The type of (redux) action which sets the visibility of the audio settings popup.
3
+ */
2
 export const SET_AUDIO_SETTINGS_VISIBILITY = 'SET_AUDIO_SETTINGS_VISIBILITY';
4
 export const SET_AUDIO_SETTINGS_VISIBILITY = 'SET_AUDIO_SETTINGS_VISIBILITY';
3
 
5
 
4
 /**
6
 /**
12
  */
14
  */
13
 export const SET_SETTINGS_VIEW_VISIBLE = 'SET_SETTINGS_VIEW_VISIBLE';
15
 export const SET_SETTINGS_VIEW_VISIBLE = 'SET_SETTINGS_VIEW_VISIBLE';
14
 
16
 
15
-// The type of (redux) action which sets the visibility of the video settings popup.
17
+/**
18
+ * The type of (redux) action which sets the visibility of the video settings popup.
19
+ */
16
 export const SET_VIDEO_SETTINGS_VISIBILITY = 'SET_VIDEO_SETTINGS_VISIBILITY';
20
 export const SET_VIDEO_SETTINGS_VISIBILITY = 'SET_VIDEO_SETTINGS_VISIBILITY';

+ 0
- 1
react/features/settings/components/web/audio/AudioSettingsHeader.js 查看文件

29
         <div className = 'audio-preview-header'>
29
         <div className = 'audio-preview-header'>
30
             <div className = 'audio-preview-header-icon'>
30
             <div className = 'audio-preview-header-icon'>
31
                 { <Icon
31
                 { <Icon
32
-                    color = '#A4B8D1'
33
                     size = { 24 }
32
                     size = { 24 }
34
                     src = { IconComponent } />}
33
                     src = { IconComponent } />}
35
             </div>
34
             </div>

+ 1
- 3
react/features/settings/components/web/audio/MicrophoneEntry.js 查看文件

107
      * @returns {void}
107
      * @returns {void}
108
      */
108
      */
109
     _stopListening(jitsiTrack) {
109
     _stopListening(jitsiTrack) {
110
-        jitsiTrack && jitsiTrack.off(
111
-            JitsiTrackEvents.TRACK_AUDIO_LEVEL_CHANGED,
112
-            this._updateLevel);
110
+        jitsiTrack && jitsiTrack.off(JitsiTrackEvents.TRACK_AUDIO_LEVEL_CHANGED, this._updateLevel);
113
         this.setState({
111
         this.setState({
114
             level: -1
112
             level: -1
115
         });
113
         });

+ 20
- 2
react/features/toolbox/components/web/AudioSettingsButton.js 查看文件

8
 import JitsiMeetJS from '../../../base/lib-jitsi-meet/_';
8
 import JitsiMeetJS from '../../../base/lib-jitsi-meet/_';
9
 import { ToolboxButtonWithIcon } from '../../../base/toolbox';
9
 import { ToolboxButtonWithIcon } from '../../../base/toolbox';
10
 import { connect } from '../../../base/redux';
10
 import { connect } from '../../../base/redux';
11
-
11
+import { getMediaPermissionPromptVisibility } from '../../../overlay';
12
 import { AudioSettingsPopup, toggleAudioSettings } from '../../../settings';
12
 import { AudioSettingsPopup, toggleAudioSettings } from '../../../settings';
13
 
13
 
14
 type Props = {
14
 type Props = {
18
      */
18
      */
19
     onAudioOptionsClick: Function,
19
     onAudioOptionsClick: Function,
20
 
20
 
21
+    /**
22
+     * Whether the permission prompt is visible or not.
23
+     * Useful for enabling the button on permission grant.
24
+     */
25
+    permissionPromptVisibility: boolean,
26
+
21
     /**
27
     /**
22
      * If the user has audio input or audio output devices.
28
      * If the user has audio input or audio output devices.
23
      */
29
      */
81
         this._updatePermissions();
87
         this._updatePermissions();
82
     }
88
     }
83
 
89
 
90
+    /**
91
+     * Implements React's {@link Component#componentDidUpdate}.
92
+     *
93
+     * @inheritdoc
94
+     */
95
+    componentDidUpdate(prevProps) {
96
+        if (this.props.permissionPromptVisibility !== prevProps.permissionPromptVisibility) {
97
+            this._updatePermissions();
98
+        }
99
+    }
100
+
84
     /**
101
     /**
85
      * Implements React's {@link Component#render}.
102
      * Implements React's {@link Component#render}.
86
      *
103
      *
113
     return {
130
     return {
114
         hasDevices:
131
         hasDevices:
115
             hasAvailableDevices(state, 'audioInput')
132
             hasAvailableDevices(state, 'audioInput')
116
-            || hasAvailableDevices(state, 'audioOutput')
133
+            || hasAvailableDevices(state, 'audioOutput'),
134
+        permissionPromptVisibility: getMediaPermissionPromptVisibility(state)
117
     };
135
     };
118
 }
136
 }
119
 
137
 

+ 20
- 1
react/features/toolbox/components/web/VideoSettingsButton.js 查看文件

9
 import { IconArrowDown } from '../../../base/icons';
9
 import { IconArrowDown } from '../../../base/icons';
10
 import { connect } from '../../../base/redux';
10
 import { connect } from '../../../base/redux';
11
 import { ToolboxButtonWithIcon } from '../../../base/toolbox';
11
 import { ToolboxButtonWithIcon } from '../../../base/toolbox';
12
+import { getMediaPermissionPromptVisibility } from '../../../overlay';
12
 
13
 
13
 type Props = {
14
 type Props = {
14
 
15
 
17
      */
18
      */
18
     onVideoOptionsClick: Function,
19
     onVideoOptionsClick: Function,
19
 
20
 
21
+    /**
22
+     * Whether the permission prompt is visible or not.
23
+     * Useful for enabling the button on initial permission grant.
24
+     */
25
+    permissionPromptVisibility: boolean,
26
+
20
     /**
27
     /**
21
      * If the user has any video devices.
28
      * If the user has any video devices.
22
      */
29
      */
80
         this._updatePermissions();
87
         this._updatePermissions();
81
     }
88
     }
82
 
89
 
90
+    /**
91
+     * Implements React's {@link Component#componentDidUpdate}.
92
+     *
93
+     * @inheritdoc
94
+     */
95
+    componentDidUpdate(prevProps) {
96
+        if (this.props.permissionPromptVisibility !== prevProps.permissionPromptVisibility) {
97
+            this._updatePermissions();
98
+        }
99
+    }
100
+
83
     /**
101
     /**
84
      * Implements React's {@link Component#render}.
102
      * Implements React's {@link Component#render}.
85
      *
103
      *
110
  */
128
  */
111
 function mapStateToProps(state) {
129
 function mapStateToProps(state) {
112
     return {
130
     return {
113
-        hasDevices: hasAvailableDevices(state, 'videoInput')
131
+        hasDevices: hasAvailableDevices(state, 'videoInput'),
132
+        permissionPromptVisibility: getMediaPermissionPromptVisibility(state)
114
     };
133
     };
115
 }
134
 }
116
 
135
 

Loading…
取消
儲存