Parcourir la source

fix(screenshare): audio screen share muted state

dev1
Andrei Gavrilescu il y a 4 ans
Parent
révision
676c7a9105
Aucun compte lié à l'adresse e-mail de l'auteur
1 fichiers modifiés avec 12 ajouts et 1 suppressions
  1. 12
    1
      modules/RTC/JitsiLocalTrack.js

+ 12
- 1
modules/RTC/JitsiLocalTrack.js Voir le fichier

@@ -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
 

Chargement…
Annuler
Enregistrer