Platform generic notification for raised hand
This commit is contained in:
parent
2dc59b9ea0
commit
6ff733dae0
|
@ -469,7 +469,7 @@
|
||||||
"moderator": "Moderator rights granted!",
|
"moderator": "Moderator rights granted!",
|
||||||
"muted": "You have started the conversation muted.",
|
"muted": "You have started the conversation muted.",
|
||||||
"mutedTitle": "You're muted!",
|
"mutedTitle": "You're muted!",
|
||||||
"raisedHand": "Would like to speak.",
|
"raisedHand": "__name__ would like to speak.",
|
||||||
"somebody": "Somebody",
|
"somebody": "Somebody",
|
||||||
"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>.",
|
"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"
|
"suboptimalExperienceTitle": "Browser Warning"
|
||||||
|
|
|
@ -188,13 +188,6 @@ UI.changeDisplayName = function(id, displayName) {
|
||||||
*/
|
*/
|
||||||
UI.setRaisedHandStatus = (id, name, raisedHandStatus) => {
|
UI.setRaisedHandStatus = (id, name, raisedHandStatus) => {
|
||||||
VideoLayout.setRaisedHandStatus(id, raisedHandStatus);
|
VideoLayout.setRaisedHandStatus(id, raisedHandStatus);
|
||||||
if (raisedHandStatus) {
|
|
||||||
messageHandler.participantNotification(
|
|
||||||
name,
|
|
||||||
'notify.somebody',
|
|
||||||
'connected',
|
|
||||||
'notify.raisedHand');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
import UIEvents from '../../../../service/UI/UIEvents';
|
import UIEvents from '../../../../service/UI/UIEvents';
|
||||||
|
|
||||||
|
import { showNotification } from '../../notifications';
|
||||||
import { CALLING, INVITED } from '../../presence-status';
|
import { CALLING, INVITED } from '../../presence-status';
|
||||||
|
|
||||||
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app';
|
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app';
|
||||||
|
@ -40,7 +41,8 @@ import {
|
||||||
getAvatarURLByParticipantId,
|
getAvatarURLByParticipantId,
|
||||||
getLocalParticipant,
|
getLocalParticipant,
|
||||||
getParticipantById,
|
getParticipantById,
|
||||||
getParticipantCount
|
getParticipantCount,
|
||||||
|
getParticipantDisplayName
|
||||||
} from './functions';
|
} from './functions';
|
||||||
import { PARTICIPANT_JOINED_FILE, PARTICIPANT_LEFT_FILE } from './sounds';
|
import { PARTICIPANT_JOINED_FILE, PARTICIPANT_LEFT_FILE } from './sounds';
|
||||||
|
|
||||||
|
@ -193,7 +195,7 @@ StateListenerRegistry.register(
|
||||||
*/
|
*/
|
||||||
StateListenerRegistry.register(
|
StateListenerRegistry.register(
|
||||||
state => state['features/base/conference'].conference,
|
state => state['features/base/conference'].conference,
|
||||||
(conference, { dispatch }) => {
|
(conference, store) => {
|
||||||
if (conference) {
|
if (conference) {
|
||||||
// We joined a conference
|
// We joined a conference
|
||||||
conference.on(
|
conference.on(
|
||||||
|
@ -207,13 +209,11 @@ StateListenerRegistry.register(
|
||||||
features: { 'screen-sharing': true }
|
features: { 'screen-sharing': true }
|
||||||
}));
|
}));
|
||||||
break;
|
break;
|
||||||
case 'raisedHand':
|
case 'raisedHand': {
|
||||||
dispatch(participantUpdated({
|
_raiseHandUpdated(
|
||||||
conference,
|
store, conference, participant, newValue);
|
||||||
id: participant.getId(),
|
|
||||||
raisedHand: newValue === 'true'
|
|
||||||
}));
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
|
|
||||||
// Ignore for now.
|
// Ignore for now.
|
||||||
|
@ -371,6 +371,34 @@ function _participantJoinedOrUpdated({ getState }, next, action) {
|
||||||
return next(action);
|
return next(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles a raise hand status update.
|
||||||
|
*
|
||||||
|
* @param {Function} dispatch - The Redux dispatch function.
|
||||||
|
* @param {Object} conference - The conference for which we got an update.
|
||||||
|
* @param {*} participant - The participant from which we got an update.
|
||||||
|
* @param {*} newValue - The new value of the raise hand status.
|
||||||
|
* @returns {void}
|
||||||
|
*/
|
||||||
|
function _raiseHandUpdated({ dispatch, getState }, conference, participant, newValue) {
|
||||||
|
const raisedHand = newValue === 'true';
|
||||||
|
|
||||||
|
dispatch(participantUpdated({
|
||||||
|
conference,
|
||||||
|
id: participant.getId(),
|
||||||
|
raisedHand
|
||||||
|
}));
|
||||||
|
|
||||||
|
if (raisedHand) {
|
||||||
|
dispatch(showNotification({
|
||||||
|
titleArguments: {
|
||||||
|
name: getParticipantDisplayName(getState, participant.getId())
|
||||||
|
},
|
||||||
|
titleKey: 'notify.raisedHand'
|
||||||
|
}, 2500));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers sounds related with the participants feature.
|
* Registers sounds related with the participants feature.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue