|
@@ -7,25 +7,6 @@ import {
|
7
|
7
|
APP_STATE_CHANGED
|
8
|
8
|
} from './actionTypes';
|
9
|
9
|
|
10
|
|
-/**
|
11
|
|
- * Signals that the App state has changed (in terms of execution state). The
|
12
|
|
- * application can be in 3 states: 'active', 'inactive' and 'background'.
|
13
|
|
- *
|
14
|
|
- * @param {string} appState - The new App state.
|
15
|
|
- * @public
|
16
|
|
- * @returns {{
|
17
|
|
- * type: APP_STATE_CHANGED,
|
18
|
|
- * appState: string
|
19
|
|
- * }}
|
20
|
|
- * @see {@link https://facebook.github.io/react-native/docs/appstate.html}
|
21
|
|
- */
|
22
|
|
-export function appStateChanged(appState: string) {
|
23
|
|
- return {
|
24
|
|
- type: APP_STATE_CHANGED,
|
25
|
|
- appState
|
26
|
|
- };
|
27
|
|
-}
|
28
|
|
-
|
29
|
10
|
/**
|
30
|
11
|
* Sets the listener to be used with React Native's AppState API.
|
31
|
12
|
*
|
|
@@ -61,21 +42,29 @@ export function _setBackgroundVideoMuted(muted: boolean) {
|
61
|
42
|
const { audioOnly } = getState()['features/base/conference'];
|
62
|
43
|
|
63
|
44
|
if (!audioOnly) {
|
64
|
|
- const { config } = getState()['features/base/lib-jitsi-meet'];
|
65
|
|
- const defaultLastN
|
66
|
|
- = typeof config.channelLastN === 'undefined'
|
67
|
|
- ? -1 : config.channelLastN;
|
|
45
|
+ let lastN;
|
|
46
|
+
|
|
47
|
+ if (muted) {
|
|
48
|
+ lastN = 0;
|
|
49
|
+ } else {
|
|
50
|
+ const { config } = getState()['features/base/lib-jitsi-meet'];
|
|
51
|
+
|
|
52
|
+ lastN = config.channelLastN;
|
|
53
|
+ if (typeof lastN === 'undefined') {
|
|
54
|
+ lastN = -1;
|
|
55
|
+ }
|
|
56
|
+ }
|
68
|
57
|
|
69
|
58
|
dispatch({
|
70
|
59
|
type: _SET_LASTN,
|
71
|
|
- lastN: muted ? 0 : defaultLastN
|
|
60
|
+ lastN
|
72
|
61
|
});
|
73
|
62
|
}
|
74
|
63
|
|
75
|
64
|
if (muted) {
|
76
|
|
- const mediaState = getState()['features/base/media'];
|
|
65
|
+ const { video } = getState()['features/base/media'];
|
77
|
66
|
|
78
|
|
- if (mediaState.video.muted) {
|
|
67
|
+ if (video.muted) {
|
79
|
68
|
// Video is already muted, do nothing.
|
80
|
69
|
return;
|
81
|
70
|
}
|
|
@@ -97,3 +86,22 @@ export function _setBackgroundVideoMuted(muted: boolean) {
|
97
|
86
|
dispatch(setVideoMuted(muted));
|
98
|
87
|
};
|
99
|
88
|
}
|
|
89
|
+
|
|
90
|
+/**
|
|
91
|
+ * Signals that the App state has changed (in terms of execution state). The
|
|
92
|
+ * application can be in 3 states: 'active', 'inactive' and 'background'.
|
|
93
|
+ *
|
|
94
|
+ * @param {string} appState - The new App state.
|
|
95
|
+ * @public
|
|
96
|
+ * @returns {{
|
|
97
|
+ * type: APP_STATE_CHANGED,
|
|
98
|
+ * appState: string
|
|
99
|
+ * }}
|
|
100
|
+ * @see {@link https://facebook.github.io/react-native/docs/appstate.html}
|
|
101
|
+ */
|
|
102
|
+export function appStateChanged(appState: string) {
|
|
103
|
+ return {
|
|
104
|
+ type: APP_STATE_CHANGED,
|
|
105
|
+ appState
|
|
106
|
+ };
|
|
107
|
+}
|