Bladeren bron

fix(blur) disable blur button if camera is off

master
Tudor D. Pop 4 jaren geleden
bovenliggende
commit
cc0ecc1fdd
No account linked to committer's email address
1 gewijzigde bestanden met toevoegingen van 22 en 1 verwijderingen
  1. 22
    1
      react/features/blur/components/VideoBlurButton.js

+ 22
- 1
react/features/blur/components/VideoBlurButton.js Bestand weergeven

@@ -6,6 +6,7 @@ import { IconBlurBackground } from '../../base/icons';
6 6
 import { connect } from '../../base/redux';
7 7
 import { AbstractButton } from '../../base/toolbox/components';
8 8
 import type { AbstractButtonProps } from '../../base/toolbox/components';
9
+import { isLocalCameraTrackMuted } from '../../base/tracks';
9 10
 import { toggleBlurEffect } from '../actions';
10 11
 
11 12
 /**
@@ -18,6 +19,11 @@ type Props = AbstractButtonProps & {
18 19
      */
19 20
     _isVideoBlurred: boolean,
20 21
 
22
+    /**
23
+     * Whether video is currently muted or not.
24
+     */
25
+    _videoMuted: boolean,
26
+
21 27
     /**
22 28
      * The redux {@code dispatch} function.
23 29
      */
@@ -60,6 +66,17 @@ class VideoBlurButton extends AbstractButton<Props, *> {
60 66
     _isToggled() {
61 67
         return this.props._isVideoBlurred;
62 68
     }
69
+
70
+    /**
71
+     * Returns {@code boolean} value indicating if disabled state is
72
+     * enabled or not.
73
+     *
74
+     * @protected
75
+     * @returns {boolean}
76
+     */
77
+    _isDisabled() {
78
+        return this.props._videoMuted;
79
+    }
63 80
 }
64 81
 
65 82
 /**
@@ -73,9 +90,13 @@ class VideoBlurButton extends AbstractButton<Props, *> {
73 90
  * }}
74 91
  */
75 92
 function _mapStateToProps(state): Object {
93
+    const tracks = state['features/base/tracks'];
94
+
76 95
     return {
77
-        _isVideoBlurred: Boolean(state['features/blur'].blurEnabled)
96
+        _isVideoBlurred: Boolean(state['features/blur'].blurEnabled),
97
+        _videoMuted: isLocalCameraTrackMuted(tracks)
78 98
     };
79 99
 }
80 100
 
81 101
 export default translate(connect(_mapStateToProps)(VideoBlurButton));
102
+

Laden…
Annuleren
Opslaan