|
@@ -1,11 +1,10 @@
|
1
|
1
|
// @flow
|
2
|
2
|
|
3
|
|
-import { isMobileBrowser } from '../../../base/environment/utils';
|
4
|
3
|
import { translate } from '../../../base/i18n';
|
5
|
4
|
import { IconCameraRefresh } from '../../../base/icons';
|
6
|
5
|
import { connect } from '../../../base/redux';
|
7
|
6
|
import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
|
8
|
|
-import { isLocalCameraTrackMuted, toggleCamera } from '../../../base/tracks';
|
|
7
|
+import { isLocalCameraTrackMuted, isToggleCameraEnabled, toggleCamera } from '../../../base/tracks';
|
9
|
8
|
|
10
|
9
|
/**
|
11
|
10
|
* The type of the React {@code Component} props of {@link ToggleCameraButton}.
|
|
@@ -65,12 +64,11 @@ class ToggleCameraButton extends AbstractButton<Props, any> {
|
65
|
64
|
function mapStateToProps(state): Object {
|
66
|
65
|
const { enabled: audioOnly } = state['features/base/audio-only'];
|
67
|
66
|
const tracks = state['features/base/tracks'];
|
68
|
|
- const { videoInput } = state['features/base/devices'].availableDevices;
|
69
|
67
|
|
70
|
68
|
return {
|
71
|
69
|
_audioOnly: Boolean(audioOnly),
|
72
|
70
|
_videoMuted: isLocalCameraTrackMuted(tracks),
|
73
|
|
- visible: isMobileBrowser() && videoInput.length > 1
|
|
71
|
+ visible: isToggleCameraEnabled(state)
|
74
|
72
|
};
|
75
|
73
|
}
|
76
|
74
|
|