Ver código fonte

fed(UI): remove UI.setAudioMuted

factor2
Hristo Terezov 1 ano atrás
pai
commit
a1ce6f1ce5
3 arquivos alterados com 5 adições e 27 exclusões
  1. 3
    12
      conference.js
  2. 0
    10
      modules/UI/UI.js
  3. 2
    5
      react/features/base/tracks/middleware.web.ts

+ 3
- 12
conference.js Ver arquivo

636
         // so that the user can try unmute later on and add audio/video
636
         // so that the user can try unmute later on and add audio/video
637
         // to the conference
637
         // to the conference
638
         if (!tracks.find(t => t.isAudioTrack())) {
638
         if (!tracks.find(t => t.isAudioTrack())) {
639
-            this.setAudioMuteStatus(true);
639
+            this.updateAudioIconEnabled();
640
         }
640
         }
641
 
641
 
642
         if (!tracks.find(t => t.isVideoTrack())) {
642
         if (!tracks.find(t => t.isVideoTrack())) {
845
             // This will only modify base/media.audio.muted which is then synced
845
             // This will only modify base/media.audio.muted which is then synced
846
             // up with the track at the end of local tracks initialization.
846
             // up with the track at the end of local tracks initialization.
847
             muteLocalAudio(mute);
847
             muteLocalAudio(mute);
848
-            this.setAudioMuteStatus(mute);
848
+            this.updateAudioIconEnabled();
849
 
849
 
850
             return;
850
             return;
851
         } else if (this.isLocalAudioMuted() === mute) {
851
         } else if (this.isLocalAudioMuted() === mute) {
1394
                 APP.store.dispatch(
1394
                 APP.store.dispatch(
1395
                 replaceLocalTrack(oldTrack, newTrack, room))
1395
                 replaceLocalTrack(oldTrack, newTrack, room))
1396
                     .then(() => {
1396
                     .then(() => {
1397
-                        this.setAudioMuteStatus(this.isLocalAudioMuted());
1397
+                        this.updateAudioIconEnabled();
1398
                     })
1398
                     })
1399
                     .then(resolve)
1399
                     .then(resolve)
1400
                     .catch(reject)
1400
                     .catch(reject)
2675
         APP.UI.setVideoMuted(this.getMyUserId());
2675
         APP.UI.setVideoMuted(this.getMyUserId());
2676
     },
2676
     },
2677
 
2677
 
2678
-    /**
2679
-     * Sets the audio muted status.
2680
-     *
2681
-     * @param {boolean} muted - New muted status.
2682
-     */
2683
-    setAudioMuteStatus(muted) {
2684
-        APP.UI.setAudioMuted(this.getMyUserId(), muted);
2685
-    },
2686
-
2687
     /**
2678
     /**
2688
      * Dispatches the passed in feedback for submission. The submitted score
2679
      * Dispatches the passed in feedback for submission. The submitted score
2689
      * should be a number inclusively between 1 through 5, or -1 for no score.
2680
      * should be a number inclusively between 1 through 5, or -1 for no score.

+ 0
- 10
modules/UI/UI.js Ver arquivo

203
     APP.store.dispatch(setFilmstripVisible(!visible));
203
     APP.store.dispatch(setFilmstripVisible(!visible));
204
 };
204
 };
205
 
205
 
206
-/**
207
- * Sets muted audio state for participant
208
- */
209
-UI.setAudioMuted = function(id) {
210
-    // FIXME: Maybe this can be removed!
211
-    if (APP.conference.isLocalId(id)) {
212
-        APP.conference.updateAudioIconEnabled();
213
-    }
214
-};
215
-
216
 /**
206
 /**
217
  * Sets muted video state for participant
207
  * Sets muted video state for participant
218
  */
208
  */

+ 2
- 5
react/features/base/tracks/middleware.web.ts Ver arquivo

75
         } else if (isVideoTrack) {
75
         } else if (isVideoTrack) {
76
             APP.conference.setVideoMuteStatus();
76
             APP.conference.setVideoMuteStatus();
77
         } else {
77
         } else {
78
-            APP.conference.setAudioMuteStatus(!muted);
78
+            APP.conference.updateAudioIconEnabled();
79
         }
79
         }
80
 
80
 
81
         break;
81
         break;
102
         }
102
         }
103
 
103
 
104
         const { jitsiTrack } = action.track;
104
         const { jitsiTrack } = action.track;
105
-        const muted = jitsiTrack.isMuted();
106
         const participantID = jitsiTrack.getParticipantId();
105
         const participantID = jitsiTrack.getParticipantId();
107
         const isVideoTrack = jitsiTrack.type !== MEDIA_TYPE.AUDIO;
106
         const isVideoTrack = jitsiTrack.type !== MEDIA_TYPE.AUDIO;
108
 
107
 
113
                 APP.UI.setVideoMuted(participantID);
112
                 APP.UI.setVideoMuted(participantID);
114
             }
113
             }
115
         } else if (jitsiTrack.isLocal()) {
114
         } else if (jitsiTrack.isLocal()) {
116
-            APP.conference.setAudioMuteStatus(muted);
117
-        } else {
118
-            APP.UI.setAudioMuted(participantID, muted);
115
+            APP.conference.updateAudioIconEnabled();
119
         }
116
         }
120
 
117
 
121
         return result;
118
         return result;

Carregando…
Cancelar
Salvar