瀏覽代碼

fix(blur) disable blur button if camera is off

master
Tudor D. Pop 4 年之前
父節點
當前提交
cc0ecc1fdd
No account linked to committer's email address
共有 1 個文件被更改,包括 22 次插入1 次删除
  1. 22
    1
      react/features/blur/components/VideoBlurButton.js

+ 22
- 1
react/features/blur/components/VideoBlurButton.js 查看文件

6
 import { connect } from '../../base/redux';
6
 import { connect } from '../../base/redux';
7
 import { AbstractButton } from '../../base/toolbox/components';
7
 import { AbstractButton } from '../../base/toolbox/components';
8
 import type { AbstractButtonProps } from '../../base/toolbox/components';
8
 import type { AbstractButtonProps } from '../../base/toolbox/components';
9
+import { isLocalCameraTrackMuted } from '../../base/tracks';
9
 import { toggleBlurEffect } from '../actions';
10
 import { toggleBlurEffect } from '../actions';
10
 
11
 
11
 /**
12
 /**
18
      */
19
      */
19
     _isVideoBlurred: boolean,
20
     _isVideoBlurred: boolean,
20
 
21
 
22
+    /**
23
+     * Whether video is currently muted or not.
24
+     */
25
+    _videoMuted: boolean,
26
+
21
     /**
27
     /**
22
      * The redux {@code dispatch} function.
28
      * The redux {@code dispatch} function.
23
      */
29
      */
60
     _isToggled() {
66
     _isToggled() {
61
         return this.props._isVideoBlurred;
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
  * }}
90
  * }}
74
  */
91
  */
75
 function _mapStateToProps(state): Object {
92
 function _mapStateToProps(state): Object {
93
+    const tracks = state['features/base/tracks'];
94
+
76
     return {
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
 export default translate(connect(_mapStateToProps)(VideoBlurButton));
101
 export default translate(connect(_mapStateToProps)(VideoBlurButton));
102
+

Loading…
取消
儲存