|
@@ -1,7 +1,4 @@
|
1
|
|
-import JitsiMeetJS, {
|
2
|
|
- JitsiTrackErrors,
|
3
|
|
- JitsiTrackEvents
|
4
|
|
-} from '../lib-jitsi-meet';
|
|
1
|
+import { JitsiTrackErrors, JitsiTrackEvents } from '../lib-jitsi-meet';
|
5
|
2
|
import {
|
6
|
3
|
CAMERA_FACING_MODE,
|
7
|
4
|
MEDIA_TYPE,
|
|
@@ -78,13 +75,13 @@ export function destroyLocalTracks() {
|
78
|
75
|
|
79
|
76
|
/**
|
80
|
77
|
* Replaces one track with another for one renegotiation instead of invoking
|
81
|
|
- * two renegotations with a separate removeTrack and addTrack. Disposes the
|
|
78
|
+ * two renegotiations with a separate removeTrack and addTrack. Disposes the
|
82
|
79
|
* removed track as well.
|
83
|
80
|
*
|
84
|
81
|
* @param {JitsiLocalTrack|null} oldTrack - The track to dispose.
|
85
|
82
|
* @param {JitsiLocalTrack|null} newTrack - The track to use instead.
|
86
|
83
|
* @param {JitsiConference} [conference] - The conference from which to remove
|
87
|
|
- * and add the tracks. If one is not provied, the conference in the redux store
|
|
84
|
+ * and add the tracks. If one is not provided, the conference in the redux store
|
88
|
85
|
* will be used.
|
89
|
86
|
* @returns {Function}
|
90
|
87
|
*/
|
|
@@ -182,7 +179,10 @@ export function trackAdded(track) {
|
182
|
179
|
* changed.
|
183
|
180
|
*
|
184
|
181
|
* @param {(JitsiLocalTrack|JitsiRemoteTrack)} track - JitsiTrack instance.
|
185
|
|
- * @returns {{ type: TRACK_UPDATED, track: Track }}
|
|
182
|
+ * @returns {{
|
|
183
|
+ * type: TRACK_UPDATED,
|
|
184
|
+ * track: Track
|
|
185
|
+ * }}
|
186
|
186
|
*/
|
187
|
187
|
export function trackMutedChanged(track) {
|
188
|
188
|
return {
|
|
@@ -199,7 +199,10 @@ export function trackMutedChanged(track) {
|
199
|
199
|
* conference.
|
200
|
200
|
*
|
201
|
201
|
* @param {(JitsiLocalTrack|JitsiRemoteTrack)} track - JitsiTrack instance.
|
202
|
|
- * @returns {{ type: TRACK_REMOVED, track: Track }}
|
|
202
|
+ * @returns {{
|
|
203
|
+ * type: TRACK_REMOVED,
|
|
204
|
+ * track: Track
|
|
205
|
+ * }}
|
203
|
206
|
*/
|
204
|
207
|
export function trackRemoved(track) {
|
205
|
208
|
track.removeAllListeners(JitsiTrackEvents.TRACK_MUTE_CHANGED);
|
|
@@ -217,7 +220,10 @@ export function trackRemoved(track) {
|
217
|
220
|
* Signal that track's video started to play.
|
218
|
221
|
*
|
219
|
222
|
* @param {(JitsiLocalTrack|JitsiRemoteTrack)} track - JitsiTrack instance.
|
220
|
|
- * @returns {{ type: TRACK_UPDATED, track: Track }}
|
|
223
|
+ * @returns {{
|
|
224
|
+ * type: TRACK_UPDATED,
|
|
225
|
+ * track: Track
|
|
226
|
+ * }}
|
221
|
227
|
*/
|
222
|
228
|
export function trackVideoStarted(track) {
|
223
|
229
|
return {
|
|
@@ -234,7 +240,10 @@ export function trackVideoStarted(track) {
|
234
|
240
|
*
|
235
|
241
|
* @param {(JitsiLocalTrack|JitsiRemoteTrack)} track - JitsiTrack instance.
|
236
|
242
|
* @param {VIDEO_TYPE|undefined} videoType - Video type.
|
237
|
|
- * @returns {{ type: TRACK_UPDATED, track: Track }}
|
|
243
|
+ * @returns {{
|
|
244
|
+ * type: TRACK_UPDATED,
|
|
245
|
+ * track: Track
|
|
246
|
+ * }}
|
238
|
247
|
*/
|
239
|
248
|
export function trackVideoTypeChanged(track, videoType) {
|
240
|
249
|
return {
|
|
@@ -254,8 +263,7 @@ export function trackVideoTypeChanged(track, videoType) {
|
254
|
263
|
* @returns {Function}
|
255
|
264
|
*/
|
256
|
265
|
function _addTracks(tracks) {
|
257
|
|
- return dispatch =>
|
258
|
|
- Promise.all(tracks.map(t => dispatch(trackAdded(t))));
|
|
266
|
+ return dispatch => Promise.all(tracks.map(t => dispatch(trackAdded(t))));
|
259
|
267
|
}
|
260
|
268
|
|
261
|
269
|
/**
|
|
@@ -311,8 +319,8 @@ function _getLocalTrack(tracks, mediaType) {
|
311
|
319
|
* tracks.
|
312
|
320
|
* @private
|
313
|
321
|
* @returns {{
|
314
|
|
- * tracksToAdd: JitsiLocalTrack[],
|
315
|
|
- * tracksToRemove: JitsiLocalTrack[]
|
|
322
|
+ * tracksToAdd: JitsiLocalTrack[],
|
|
323
|
+ * tracksToRemove: JitsiLocalTrack[]
|
316
|
324
|
* }}
|
317
|
325
|
*/
|
318
|
326
|
function _getLocalTracksToChange(currentTracks, newTracks) {
|
|
@@ -363,8 +371,7 @@ function _shouldMirror(track) {
|
363
|
371
|
// of the value on the right side of the equality check is defined
|
364
|
372
|
// by jitsi-meet. The type definitions are surely compatible today
|
365
|
373
|
// but that may not be the case tomorrow.
|
366
|
|
- && track.getCameraFacingMode() === CAMERA_FACING_MODE.USER
|
367
|
|
- );
|
|
374
|
+ && track.getCameraFacingMode() === CAMERA_FACING_MODE.USER);
|
368
|
375
|
}
|
369
|
376
|
|
370
|
377
|
/**
|