Browse Source

[RN] Disable video mute and camera switch buttons when in audio only mode

master
Saúl Ibarra Corretgé 8 years ago
parent
commit
03da40b56a
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      react/features/toolbox/components/Toolbox.native.js

+ 5
- 3
react/features/toolbox/components/Toolbox.native.js View File

154
     _renderPrimaryToolbar() {
154
     _renderPrimaryToolbar() {
155
         const audioButtonStyles = this._getMuteButtonStyles(MEDIA_TYPE.AUDIO);
155
         const audioButtonStyles = this._getMuteButtonStyles(MEDIA_TYPE.AUDIO);
156
         const videoButtonStyles = this._getMuteButtonStyles(MEDIA_TYPE.VIDEO);
156
         const videoButtonStyles = this._getMuteButtonStyles(MEDIA_TYPE.VIDEO);
157
+        const { _audioOnly: audioOnly } = this.props;
157
 
158
 
158
         /* eslint-disable react/jsx-handler-names */
159
         /* eslint-disable react/jsx-handler-names */
159
 
160
 
171
                     style = { styles.hangup }
172
                     style = { styles.hangup }
172
                     underlayColor = { ColorPalette.buttonUnderlay } />
173
                     underlayColor = { ColorPalette.buttonUnderlay } />
173
                 <ToolbarButton
174
                 <ToolbarButton
175
+                    disabled = { audioOnly }
174
                     iconName = { videoButtonStyles.iconName }
176
                     iconName = { videoButtonStyles.iconName }
175
                     iconStyle = { videoButtonStyles.iconStyle }
177
                     iconStyle = { videoButtonStyles.iconStyle }
176
                     onClick = { this.props._onToggleVideo }
178
                     onClick = { this.props._onToggleVideo }
192
         const iconStyle = styles.secondaryToolbarButtonIcon;
194
         const iconStyle = styles.secondaryToolbarButtonIcon;
193
         const style = styles.secondaryToolbarButton;
195
         const style = styles.secondaryToolbarButton;
194
         const underlayColor = 'transparent';
196
         const underlayColor = 'transparent';
197
+        const { _audioOnly: audioOnly } = this.props;
195
 
198
 
196
         /* eslint-disable react/jsx-curly-spacing,react/jsx-handler-names */
199
         /* eslint-disable react/jsx-curly-spacing,react/jsx-handler-names */
197
 
200
 
198
         return (
201
         return (
199
             <View style = { styles.secondaryToolbar }>
202
             <View style = { styles.secondaryToolbar }>
200
                 <ToolbarButton
203
                 <ToolbarButton
204
+                    disabled = { audioOnly }
201
                     iconName = 'switch-camera'
205
                     iconName = 'switch-camera'
202
                     iconStyle = { iconStyle }
206
                     iconStyle = { iconStyle }
203
                     onClick = { this.props._onToggleCameraFacingMode }
207
                     onClick = { this.props._onToggleCameraFacingMode }
212
                     style = { style }
216
                     style = { style }
213
                     underlayColor = { underlayColor } />
217
                     underlayColor = { underlayColor } />
214
                 <ToolbarButton
218
                 <ToolbarButton
215
-                    iconName = {
216
-                        this.props._audioOnly ? 'visibility-off' : 'visibility'
217
-                    }
219
+                    iconName = { audioOnly ? 'visibility-off' : 'visibility' }
218
                     iconStyle = { iconStyle }
220
                     iconStyle = { iconStyle }
219
                     onClick = { this.props._onToggleAudioOnly }
221
                     onClick = { this.props._onToggleAudioOnly }
220
                     style = { style }
222
                     style = { style }

Loading…
Cancel
Save