Quellcode durchsuchen

Comply w/ coding style

master
Lyubomir Marinov vor 8 Jahren
Ursprung
Commit
4f8b7a934c

+ 3
- 3
react/features/base/media/actionTypes.js Datei anzeigen

@@ -1,7 +1,7 @@
1 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 7
  *      type: SET_AUDIO_MUTED,
@@ -11,7 +11,7 @@ import { Symbol } from '../react';
11 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 17
  *      type: SET_CAMERA_FACING_MODE,
@@ -21,7 +21,7 @@ export const SET_AUDIO_MUTED = Symbol('SET_AUDIO_MUTED');
21 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 27
  *      type: SET_VIDEO_MUTED,

+ 22
- 20
react/features/base/media/actions.js Datei anzeigen

@@ -8,9 +8,10 @@ import './middleware';
8 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 15
  * @returns {{
15 16
  *      type: SET_AUDIO_MUTED,
16 17
  *      muted: boolean
@@ -24,9 +25,9 @@ export function setAudioMuted(muted) {
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 31
  * @returns {{
31 32
  *      type: SET_CAMERA_FACING_MODE,
32 33
  *      cameraFacingMode: CAMERA_FACING_MODE
@@ -39,6 +40,23 @@ export function setCameraFacingMode(cameraFacingMode) {
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 61
  * Toggles the mute state of the local audio track(s).
44 62
  *
@@ -83,19 +101,3 @@ export function toggleVideoMuted() {
83 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 Datei anzeigen

@@ -9,6 +9,21 @@ import {
9 9
 } from './actionTypes';
10 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 28
  * Media state object for local audio.
14 29
  *
@@ -90,18 +105,3 @@ function video(state = VIDEO_INITIAL_MEDIA_STATE, action) {
90 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 Datei anzeigen

@@ -1,7 +1,4 @@
1
-import {
2
-    LIB_DISPOSED,
3
-    LIB_INITIALIZED
4
-} from '../lib-jitsi-meet';
1
+import { LIB_DISPOSED, LIB_INITIALIZED } from '../lib-jitsi-meet';
5 2
 import {
6 3
     MEDIA_TYPE,
7 4
     SET_AUDIO_MUTED,
@@ -12,15 +9,9 @@ import {
12 9
 } from '../media';
13 10
 import { MiddlewareRegistry } from '../redux';
14 11
 
15
-import {
16
-    createLocalTracks,
17
-    destroyLocalTracks
18
-} from './actions';
12
+import { createLocalTracks, destroyLocalTracks } from './actions';
19 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 17
  * Middleware that captures LIB_INITIALIZED and LIB_DISPOSED actions
@@ -32,6 +23,14 @@ import {
32 23
  */
33 24
 MiddlewareRegistry.register(store => next => action => {
34 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 34
     case SET_AUDIO_MUTED:
36 35
         _setMuted(store, action, MEDIA_TYPE.AUDIO);
37 36
         break;
@@ -45,20 +44,12 @@ MiddlewareRegistry.register(store => next => action => {
45 44
         );
46 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 49
         break;
55 50
 
56 51
     case TRACK_UPDATED:
57 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 55
     return next(action);

+ 2
- 5
react/features/largeVideo/actions.js Datei anzeigen

@@ -1,8 +1,5 @@
1 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 3
 import {
7 4
     getLocalVideoTrack,
8 5
     getTrackByMediaTypeAndParticipant
@@ -48,7 +45,7 @@ export function selectParticipant() {
48 45
 /**
49 46
  * Action to select the participant to be displayed in LargeVideo based on a
50 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 50
  * @returns {Function}
54 51
  */

Laden…
Abbrechen
Speichern