Adds back talk while muted notification. (#4392)

* Adds back talk while muted notification.

* Adds unmute button to the notification.
This commit is contained in:
Дамян Минков 2019-07-02 12:59:25 +01:00 committed by GitHub
parent 1baa85b649
commit 681782ed20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 3 deletions

View File

@ -78,7 +78,10 @@ import {
setVideoAvailable,
setVideoMuted
} from './react/features/base/media';
import { showNotification } from './react/features/notifications';
import {
hideNotification,
showNotification
} from './react/features/notifications';
import {
dominantSpeakerChanged,
getLocalParticipant,
@ -1776,14 +1779,29 @@ export default {
APP.UI.setAudioLevel(id, newLvl);
});
room.on(JitsiConferenceEvents.TRACK_MUTE_CHANGED, (_, participantThatMutedUs) => {
// we store the last start muted notification id that we showed,
// so we can hide it when unmuted mic is detected
let lastNotificationId;
room.on(JitsiConferenceEvents.TRACK_MUTE_CHANGED, (track, participantThatMutedUs) => {
if (participantThatMutedUs) {
APP.store.dispatch(participantMutedUs(participantThatMutedUs));
}
if (lastNotificationId && track.isAudioTrack() && track.isLocal() && !track.isMuted()) {
APP.store.dispatch(hideNotification(lastNotificationId));
lastNotificationId = undefined;
}
});
room.on(JitsiConferenceEvents.TALK_WHILE_MUTED, () => {
APP.UI.showToolbar(6000);
const action = APP.store.dispatch(showNotification({
titleKey: 'toolbar.talkWhileMutedPopup',
customActionNameKey: 'notify.unmute',
customActionHandler: muteLocalAudio.bind(this, false)
}));
lastNotificationId = action.uid;
});
room.on(JitsiConferenceEvents.SUBJECT_CHANGED,
subject => APP.store.dispatch(conferenceSubjectChanged(subject)));

View File

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