|
@@ -13,8 +13,9 @@ import {
|
13
|
13
|
} from '../media';
|
14
|
14
|
import { MiddlewareRegistry } from '../redux';
|
15
|
15
|
|
|
16
|
+import { setTrackMuted } from './actions';
|
16
|
17
|
import { TRACK_ADDED, TRACK_REMOVED, TRACK_UPDATED } from './actionTypes';
|
17
|
|
-import { getLocalTrack, setTrackMuted } from './functions';
|
|
18
|
+import { getLocalTrack } from './functions';
|
18
|
19
|
|
19
|
20
|
declare var APP: Object;
|
20
|
21
|
|
|
@@ -23,7 +24,7 @@ declare var APP: Object;
|
23
|
24
|
* respectively, creates/destroys local media tracks. Also listens to
|
24
|
25
|
* media-related actions and performs corresponding operations with tracks.
|
25
|
26
|
*
|
26
|
|
- * @param {Store} store - Redux store.
|
|
27
|
+ * @param {Store} store - The redux store.
|
27
|
28
|
* @returns {Function}
|
28
|
29
|
*/
|
29
|
30
|
MiddlewareRegistry.register(store => next => action => {
|
|
@@ -132,9 +133,9 @@ MiddlewareRegistry.register(store => next => action => {
|
132
|
133
|
|
133
|
134
|
/**
|
134
|
135
|
* Gets the local track associated with a specific <tt>MEDIA_TYPE</tt> in a
|
135
|
|
- * specific Redux store.
|
|
136
|
+ * specific redux store.
|
136
|
137
|
*
|
137
|
|
- * @param {Store} store - The Redux store from which the local track associated
|
|
138
|
+ * @param {Store} store - The redux store from which the local track associated
|
138
|
139
|
* with the specified <tt>mediaType</tt> is to be retrieved.
|
139
|
140
|
* @param {MEDIA_TYPE} mediaType - The <tt>MEDIA_TYPE</tt> of the local track to
|
140
|
141
|
* be retrieved from the specified <tt>store</tt>.
|
|
@@ -149,20 +150,18 @@ function _getLocalTrack(store, mediaType: MEDIA_TYPE) {
|
149
|
150
|
/**
|
150
|
151
|
* Mutes or unmutes a local track with a specific media type.
|
151
|
152
|
*
|
152
|
|
- * @param {Store} store - The Redux store in which the specified action is
|
|
153
|
+ * @param {Store} store - The redux store in which the specified action is
|
153
|
154
|
* dispatched.
|
154
|
|
- * @param {Action} action - The Redux action dispatched in the specified store.
|
|
155
|
+ * @param {Action} action - The redux action dispatched in the specified store.
|
155
|
156
|
* @param {MEDIA_TYPE} mediaType - The {@link MEDIA_TYPE} of the local track
|
156
|
157
|
* which is being muted or unmuted.
|
157
|
158
|
* @private
|
158
|
159
|
* @returns {void}
|
159
|
160
|
*/
|
160
|
|
-function _setMuted(store, action, mediaType: MEDIA_TYPE) {
|
|
161
|
+function _setMuted(store, { muted }, mediaType: MEDIA_TYPE) {
|
161
|
162
|
const localTrack = _getLocalTrack(store, mediaType);
|
162
|
163
|
|
163
|
|
- if (localTrack) {
|
164
|
|
- setTrackMuted(localTrack.jitsiTrack, action.muted, store);
|
165
|
|
- }
|
|
164
|
+ localTrack && store.dispatch(setTrackMuted(localTrack.jitsiTrack, muted));
|
166
|
165
|
}
|
167
|
166
|
|
168
|
167
|
/**
|
|
@@ -170,11 +169,11 @@ function _setMuted(store, action, mediaType: MEDIA_TYPE) {
|
170
|
169
|
* muted states of the local tracks of features/base/tracks with the muted
|
171
|
170
|
* states of features/base/media.
|
172
|
171
|
*
|
173
|
|
- * @param {Store} store - The Redux store in which the specified <tt>action</tt>
|
|
172
|
+ * @param {Store} store - The redux store in which the specified <tt>action</tt>
|
174
|
173
|
* is being dispatched.
|
175
|
|
- * @param {Dispatch} next - The Redux dispatch function to dispatch the
|
|
174
|
+ * @param {Dispatch} next - The redux dispatch function to dispatch the
|
176
|
175
|
* specified <tt>action</tt> to the specified <tt>store</tt>.
|
177
|
|
- * @param {Action} action - The Redux action <tt>TRACK_UPDATED</tt> which is
|
|
176
|
+ * @param {Action} action - The redux action <tt>TRACK_UPDATED</tt> which is
|
178
|
177
|
* being dispatched in the specified <tt>store</tt>.
|
179
|
178
|
* @private
|
180
|
179
|
* @returns {Object} The new state that is the result of the reduction of the
|