Преглед изворни кода

Adds back talk while muted notification. (#4392)

* Adds back talk while muted notification.

* Adds unmute button to the notification.
master
Дамян Минков пре 6 година
родитељ
комит
681782ed20
No account linked to committer's email address
2 измењених фајлова са 22 додато и 3 уклоњено
  1. 21
    3
      conference.js
  2. 1
    0
      lang/main.json

+ 21
- 3
conference.js Прегледај датотеку

78
     setVideoAvailable,
78
     setVideoAvailable,
79
     setVideoMuted
79
     setVideoMuted
80
 } from './react/features/base/media';
80
 } from './react/features/base/media';
81
-import { showNotification } from './react/features/notifications';
81
+import {
82
+    hideNotification,
83
+    showNotification
84
+} from './react/features/notifications';
82
 import {
85
 import {
83
     dominantSpeakerChanged,
86
     dominantSpeakerChanged,
84
     getLocalParticipant,
87
     getLocalParticipant,
1776
             APP.UI.setAudioLevel(id, newLvl);
1779
             APP.UI.setAudioLevel(id, newLvl);
1777
         });
1780
         });
1778
 
1781
 
1779
-        room.on(JitsiConferenceEvents.TRACK_MUTE_CHANGED, (_, participantThatMutedUs) => {
1782
+        // we store the last start muted notification id that we showed,
1783
+        // so we can hide it when unmuted mic is detected
1784
+        let lastNotificationId;
1785
+
1786
+        room.on(JitsiConferenceEvents.TRACK_MUTE_CHANGED, (track, participantThatMutedUs) => {
1780
             if (participantThatMutedUs) {
1787
             if (participantThatMutedUs) {
1781
                 APP.store.dispatch(participantMutedUs(participantThatMutedUs));
1788
                 APP.store.dispatch(participantMutedUs(participantThatMutedUs));
1782
             }
1789
             }
1790
+
1791
+            if (lastNotificationId && track.isAudioTrack() && track.isLocal() && !track.isMuted()) {
1792
+                APP.store.dispatch(hideNotification(lastNotificationId));
1793
+                lastNotificationId = undefined;
1794
+            }
1783
         });
1795
         });
1784
 
1796
 
1785
         room.on(JitsiConferenceEvents.TALK_WHILE_MUTED, () => {
1797
         room.on(JitsiConferenceEvents.TALK_WHILE_MUTED, () => {
1786
-            APP.UI.showToolbar(6000);
1798
+            const action = APP.store.dispatch(showNotification({
1799
+                titleKey: 'toolbar.talkWhileMutedPopup',
1800
+                customActionNameKey: 'notify.unmute',
1801
+                customActionHandler: muteLocalAudio.bind(this, false)
1802
+            }));
1803
+
1804
+            lastNotificationId = action.uid;
1787
         });
1805
         });
1788
         room.on(JitsiConferenceEvents.SUBJECT_CHANGED,
1806
         room.on(JitsiConferenceEvents.SUBJECT_CHANGED,
1789
             subject => APP.store.dispatch(conferenceSubjectChanged(subject)));
1807
             subject => APP.store.dispatch(conferenceSubjectChanged(subject)));

+ 1
- 0
lang/main.json Прегледај датотеку

488
         "startSilentDescription": "Rejoin the meeting to enable audio",
488
         "startSilentDescription": "Rejoin the meeting to enable audio",
489
         "suboptimalExperienceDescription": "Eer... we are afraid your experience with __appName__ isn't going to be that great here. We are looking for ways to improve this but, until then, please try using one of the <a href='static/recommendedBrowsers.html' target='_blank'>fully supported browsers</a>.",
489
         "suboptimalExperienceDescription": "Eer... we are afraid your experience with __appName__ isn't going to be that great here. We are looking for ways to improve this but, until then, please try using one of the <a href='static/recommendedBrowsers.html' target='_blank'>fully supported browsers</a>.",
490
         "suboptimalExperienceTitle": "Browser Warning",
490
         "suboptimalExperienceTitle": "Browser Warning",
491
+        "unmute": "Unmute",
491
         "newDeviceCameraTitle": "New camera detected",
492
         "newDeviceCameraTitle": "New camera detected",
492
         "newDeviceAudioTitle": "New audio device detected",
493
         "newDeviceAudioTitle": "New audio device detected",
493
         "newDeviceAction": "Use"
494
         "newDeviceAction": "Use"

Loading…
Откажи
Сачувај