Browse Source

fix(screenshare): audio screen share muted state

dev1
Andrei Gavrilescu 4 years ago
parent
commit
676c7a9105
No account linked to committer's email address
1 changed files with 12 additions and 1 deletions
  1. 12
    1
      modules/RTC/JitsiLocalTrack.js

+ 12
- 1
modules/RTC/JitsiLocalTrack.js View File

@@ -510,7 +510,13 @@ export default class JitsiLocalTrack extends JitsiTrack {
510 510
                 || this.videoType === VideoType.DESKTOP
511 511
                 || !browser.doesVideoMuteByStreamRemove()) {
512 512
             logMuteInfo();
513
-            if (this.track) {
513
+
514
+            // If we have a stream effect that implements its own mute functionality, prioritize it before
515
+            // normal mute e.g. the stream effect that implements system audio sharing has a custom
516
+            // mute state in which if the user mutes, system audio still has to go through.
517
+            if (this._streamEffect && this._streamEffect.setMuted) {
518
+                this._streamEffect.setMuted(muted);
519
+            } else if (this.track) {
514 520
                 this.track.enabled = !muted;
515 521
             }
516 522
         } else if (muted) {
@@ -714,6 +720,11 @@ export default class JitsiLocalTrack extends JitsiTrack {
714 720
             return true;
715 721
         }
716 722
 
723
+        // If currently used stream effect has its own muted state, use that.
724
+        if (this._streamEffect && this._streamEffect.isMuted) {
725
+            return this._streamEffect.isMuted();
726
+        }
727
+
717 728
         return !this.track || !this.track.enabled;
718 729
     }
719 730
 

Loading…
Cancel
Save