Переглянути джерело

Fixes the local audio levels when the user is muted.

j8
hristoterezov 11 роки тому
джерело
коміт
0e7c1ed9a9
1 змінених файлів з 16 додано та 0 видалено
  1. 16
    0
      app.js

+ 16
- 0
app.js Переглянути файл

455
     if(jid === LocalStatsCollector.LOCAL_JID)
455
     if(jid === LocalStatsCollector.LOCAL_JID)
456
     {
456
     {
457
         resourceJid = AudioLevels.LOCAL_LEVEL;
457
         resourceJid = AudioLevels.LOCAL_LEVEL;
458
+        if(isAudioMuted())
459
+            return;
458
     }
460
     }
459
     else
461
     else
460
     {
462
     {
901
     buttonClick("#mute", "icon-microphone icon-mic-disabled");
903
     buttonClick("#mute", "icon-microphone icon-mic-disabled");
902
 }
904
 }
903
 
905
 
906
+/**
907
+ * Checks whether the audio is muted or not.
908
+ * @returns {boolean} true if audio is muted and false if not.
909
+ */
910
+function isAudioMuted()
911
+{
912
+    var localAudio = connection.jingle.localAudio;
913
+    for (var idx = 0; idx < localAudio.getAudioTracks().length; idx++) {
914
+        if(localAudio.getAudioTracks()[idx].enabled === true)
915
+            return false;
916
+    }
917
+    return true;
918
+}
919
+
904
 // Starts or stops the recording for the conference.
920
 // Starts or stops the recording for the conference.
905
 function toggleRecording() {
921
 function toggleRecording() {
906
     if (focus === null || focus.confid === null) {
922
     if (focus === null || focus.confid === null) {

Завантаження…
Відмінити
Зберегти