Browse Source

fix(JitsiLocalTrack): restore 'inMuteOrUnmuteProgress'

Restores 'inMuteOrUnmuteProgress' flag used by the LocalSdpMunger.

(cherry picked from commit 2e6c4dd)
master
paweldomas 7 years ago
parent
commit
8c1283c7fd
1 changed files with 15 additions and 0 deletions
  1. 15
    0
      modules/RTC/JitsiLocalTrack.js

+ 15
- 0
modules/RTC/JitsiLocalTrack.js View File

@@ -127,6 +127,13 @@ export default class JitsiLocalTrack extends JitsiTrack {
127 127
         // soon as it's called.
128 128
         this._realDeviceId = this.deviceId === '' ? undefined : this.deviceId;
129 129
 
130
+        /**
131
+         * Set to <tt>true</tt> when there's ongoing "mute/unmute" operation in
132
+         * progress. Used by {@link LocalSdpMunger}.
133
+         * @type {boolean}
134
+         */
135
+        this.inMuteOrUnmuteProgress = true;
136
+
130 137
         /**
131 138
          * Indicates that we have called RTCUtils.stopMediaStream for the
132 139
          * MediaStream related to this JitsiTrack object.
@@ -334,6 +341,7 @@ export default class JitsiLocalTrack extends JitsiTrack {
334 341
 
335 342
         let promise = Promise.resolve();
336 343
 
344
+        this.inMuteOrUnmuteProgress = true;
337 345
         this.dontFireRemoveEvent = false;
338 346
 
339 347
         // A function that will print info about muted status transition
@@ -406,6 +414,13 @@ export default class JitsiLocalTrack extends JitsiTrack {
406 414
 
407 415
         return promise
408 416
             .then(() => this._sendMuteStatus(mute))
417
+            .then(() => {
418
+                this.inMuteOrUnmuteProgress = false;
419
+            }, error => {
420
+                this.inMuteOrUnmuteProgress = false;
421
+
422
+                throw error;
423
+            })
409 424
             .then(() => {
410 425
                 this.emit(JitsiTrackEvents.TRACK_MUTE_CHANGED, this);
411 426
             });

Loading…
Cancel
Save