Parcourir la source

Adds back talk while muted notification. (#4392)

* Adds back talk while muted notification.

* Adds unmute button to the notification.
master
Дамян Минков il y a 6 ans
Parent
révision
681782ed20
Aucun compte lié à l'adresse e-mail de l'auteur
2 fichiers modifiés avec 22 ajouts et 3 suppressions
  1. 21
    3
      conference.js
  2. 1
    0
      lang/main.json

+ 21
- 3
conference.js Voir le fichier

@@ -78,7 +78,10 @@ import {
78 78
     setVideoAvailable,
79 79
     setVideoMuted
80 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 85
 import {
83 86
     dominantSpeakerChanged,
84 87
     getLocalParticipant,
@@ -1776,14 +1779,29 @@ export default {
1776 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 1787
             if (participantThatMutedUs) {
1781 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 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 1806
         room.on(JitsiConferenceEvents.SUBJECT_CHANGED,
1789 1807
             subject => APP.store.dispatch(conferenceSubjectChanged(subject)));

+ 1
- 0
lang/main.json Voir le fichier

@@ -488,6 +488,7 @@
488 488
         "startSilentDescription": "Rejoin the meeting to enable audio",
489 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 490
         "suboptimalExperienceTitle": "Browser Warning",
491
+        "unmute": "Unmute",
491 492
         "newDeviceCameraTitle": "New camera detected",
492 493
         "newDeviceAudioTitle": "New audio device detected",
493 494
         "newDeviceAction": "Use"

Chargement…
Annuler
Enregistrer