瀏覽代碼

Comply w/ coding style

master
Lyubomir Marinov 8 年之前
父節點
當前提交
4f8b7a934c

+ 3
- 3
react/features/base/media/actionTypes.js 查看文件

1
 import { Symbol } from '../react';
1
 import { Symbol } from '../react';
2
 
2
 
3
 /**
3
 /**
4
- * Action to change the muted state of the local audio.
4
+ * Action to set the muted state of the local audio.
5
  *
5
  *
6
  * {
6
  * {
7
  *      type: SET_AUDIO_MUTED,
7
  *      type: SET_AUDIO_MUTED,
11
 export const SET_AUDIO_MUTED = Symbol('SET_AUDIO_MUTED');
11
 export const SET_AUDIO_MUTED = Symbol('SET_AUDIO_MUTED');
12
 
12
 
13
 /**
13
 /**
14
- * Action to change the facing mode of the local video camera.
14
+ * Action to set the facing mode of the local video camera.
15
  *
15
  *
16
  * {
16
  * {
17
  *      type: SET_CAMERA_FACING_MODE,
17
  *      type: SET_CAMERA_FACING_MODE,
21
 export const SET_CAMERA_FACING_MODE = Symbol('SET_CAMERA_FACING_MODE');
21
 export const SET_CAMERA_FACING_MODE = Symbol('SET_CAMERA_FACING_MODE');
22
 
22
 
23
 /**
23
 /**
24
- * Action to change the muted state of the local video.
24
+ * Action to set the muted state of the local video.
25
  *
25
  *
26
  * {
26
  * {
27
  *      type: SET_VIDEO_MUTED,
27
  *      type: SET_VIDEO_MUTED,

+ 22
- 20
react/features/base/media/actions.js 查看文件

8
 import './reducer';
8
 import './reducer';
9
 
9
 
10
 /**
10
 /**
11
- * Action to change the local audio muted state.
11
+ * Action to set the muted state of the local audio.
12
  *
12
  *
13
- * @param {boolean} muted - If local audio is muted.
13
+ * @param {boolean} muted - True if the local audio is to be muted or false if
14
+ * the local audio is to be unmuted.
14
  * @returns {{
15
  * @returns {{
15
  *      type: SET_AUDIO_MUTED,
16
  *      type: SET_AUDIO_MUTED,
16
  *      muted: boolean
17
  *      muted: boolean
24
 }
25
 }
25
 
26
 
26
 /**
27
 /**
27
- * Action to change the facing mode of the local video camera.
28
+ * Action to set the facing mode of the local camera.
28
  *
29
  *
29
- * @param {CAMERA_FACING_MODE} cameraFacingMode - Camera facing mode.
30
+ * @param {CAMERA_FACING_MODE} cameraFacingMode - The camera facing mode to set.
30
  * @returns {{
31
  * @returns {{
31
  *      type: SET_CAMERA_FACING_MODE,
32
  *      type: SET_CAMERA_FACING_MODE,
32
  *      cameraFacingMode: CAMERA_FACING_MODE
33
  *      cameraFacingMode: CAMERA_FACING_MODE
39
     };
40
     };
40
 }
41
 }
41
 
42
 
43
+/**
44
+ * Action to set the muted state of the local video.
45
+ *
46
+ * @param {boolean} muted - True if the local video is to be muted or false if
47
+ * the local video is to be unmuted.
48
+ * @returns {{
49
+ *      type: SET_VIDEO_MUTED,
50
+ *      muted: boolean
51
+ *  }}
52
+ */
53
+export function setVideoMuted(muted) {
54
+    return {
55
+        type: SET_VIDEO_MUTED,
56
+        muted
57
+    };
58
+}
59
+
42
 /**
60
 /**
43
  * Toggles the mute state of the local audio track(s).
61
  * Toggles the mute state of the local audio track(s).
44
  *
62
  *
83
         return dispatch(setVideoMuted(!muted));
101
         return dispatch(setVideoMuted(!muted));
84
     };
102
     };
85
 }
103
 }
86
-
87
-/**
88
- * Action to change the local video muted state.
89
- *
90
- * @param {boolean} muted - If local video is muted.
91
- * @returns {{
92
- *      type: SET_VIDEO_MUTED,
93
- *      muted: boolean
94
- *  }}
95
- */
96
-export function setVideoMuted(muted) {
97
-    return {
98
-        type: SET_VIDEO_MUTED,
99
-        muted
100
-    };
101
-}

+ 15
- 15
react/features/base/media/reducer.js 查看文件

9
 } from './actionTypes';
9
 } from './actionTypes';
10
 import { CAMERA_FACING_MODE } from './constants';
10
 import { CAMERA_FACING_MODE } from './constants';
11
 
11
 
12
+/**
13
+ * Listen for various actions related to media devices.
14
+ *
15
+ * @param {Object} state - State of media devices.
16
+ * @param {Object} action - Action object.
17
+ * @param {string} action.type - Type of action.
18
+ * @param {Object} action.media - Information about media devices to be
19
+ * modified.
20
+ * @returns {Object}
21
+ */
22
+ReducerRegistry.register('features/base/media', combineReducers({
23
+    audio,
24
+    video
25
+}));
26
+
12
 /**
27
 /**
13
  * Media state object for local audio.
28
  * Media state object for local audio.
14
  *
29
  *
90
         return state;
105
         return state;
91
     }
106
     }
92
 }
107
 }
93
-
94
-/**
95
- * Listen for various actions related to media devices.
96
- *
97
- * @param {Object} state - State of media devices.
98
- * @param {Object} action - Action object.
99
- * @param {string} action.type - Type of action.
100
- * @param {Object} action.media - Information about media devices to be
101
- * modified.
102
- * @returns {Object}
103
- */
104
-ReducerRegistry.register('features/base/media', combineReducers({
105
-    audio,
106
-    video
107
-}));

+ 13
- 22
react/features/base/tracks/middleware.js 查看文件

1
-import {
2
-    LIB_DISPOSED,
3
-    LIB_INITIALIZED
4
-} from '../lib-jitsi-meet';
1
+import { LIB_DISPOSED, LIB_INITIALIZED } from '../lib-jitsi-meet';
5
 import {
2
 import {
6
     MEDIA_TYPE,
3
     MEDIA_TYPE,
7
     SET_AUDIO_MUTED,
4
     SET_AUDIO_MUTED,
12
 } from '../media';
9
 } from '../media';
13
 import { MiddlewareRegistry } from '../redux';
10
 import { MiddlewareRegistry } from '../redux';
14
 
11
 
15
-import {
16
-    createLocalTracks,
17
-    destroyLocalTracks
18
-} from './actions';
12
+import { createLocalTracks, destroyLocalTracks } from './actions';
19
 import { TRACK_UPDATED } from './actionTypes';
13
 import { TRACK_UPDATED } from './actionTypes';
20
-import {
21
-    getLocalTrack,
22
-    setTrackMuted
23
-} from './functions';
14
+import { getLocalTrack, setTrackMuted } from './functions';
24
 
15
 
25
 /**
16
 /**
26
  * Middleware that captures LIB_INITIALIZED and LIB_DISPOSED actions
17
  * Middleware that captures LIB_INITIALIZED and LIB_DISPOSED actions
32
  */
23
  */
33
 MiddlewareRegistry.register(store => next => action => {
24
 MiddlewareRegistry.register(store => next => action => {
34
     switch (action.type) {
25
     switch (action.type) {
26
+    case LIB_INITIALIZED:
27
+        store.dispatch(createLocalTracks());
28
+        break;
29
+
30
+    case LIB_DISPOSED:
31
+        store.dispatch(destroyLocalTracks());
32
+        break;
33
+
35
     case SET_AUDIO_MUTED:
34
     case SET_AUDIO_MUTED:
36
         _setMuted(store, action, MEDIA_TYPE.AUDIO);
35
         _setMuted(store, action, MEDIA_TYPE.AUDIO);
37
         break;
36
         break;
45
         );
44
         );
46
         break;
45
         break;
47
 
46
 
48
-    case LIB_INITIALIZED:
49
-        store.dispatch(createLocalTracks());
50
-        break;
51
-
52
-    case LIB_DISPOSED:
53
-        store.dispatch(destroyLocalTracks());
47
+    case SET_VIDEO_MUTED:
48
+        _setMuted(store, action, MEDIA_TYPE.VIDEO);
54
         break;
49
         break;
55
 
50
 
56
     case TRACK_UPDATED:
51
     case TRACK_UPDATED:
57
         return _trackUpdated(store, next, action);
52
         return _trackUpdated(store, next, action);
58
-
59
-    case SET_VIDEO_MUTED:
60
-        _setMuted(store, action, MEDIA_TYPE.VIDEO);
61
-        break;
62
     }
53
     }
63
 
54
 
64
     return next(action);
55
     return next(action);

+ 2
- 5
react/features/largeVideo/actions.js 查看文件

1
 import { _handleParticipantError } from '../base/conference';
1
 import { _handleParticipantError } from '../base/conference';
2
-import {
3
-    MEDIA_TYPE,
4
-    VIDEO_TYPE
5
-} from '../base/media';
2
+import { MEDIA_TYPE, VIDEO_TYPE } from '../base/media';
6
 import {
3
 import {
7
     getLocalVideoTrack,
4
     getLocalVideoTrack,
8
     getTrackByMediaTypeAndParticipant
5
     getTrackByMediaTypeAndParticipant
48
 /**
45
 /**
49
  * Action to select the participant to be displayed in LargeVideo based on a
46
  * Action to select the participant to be displayed in LargeVideo based on a
50
  * variety of factors: if there is a dominant or pinned speaker, or if there are
47
  * variety of factors: if there is a dominant or pinned speaker, or if there are
51
- * remote tracks etc.
48
+ * remote tracks, etc.
52
  *
49
  *
53
  * @returns {Function}
50
  * @returns {Function}
54
  */
51
  */

Loading…
取消
儲存