feat: emit raise hand event to external API (#8312)
* Expose raise hand event to external application * Fix linting issues * fix the app non existing issue
This commit is contained in:
parent
97dc07810c
commit
cd29f10fa8
|
@ -1022,6 +1022,21 @@ class API {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Notify external application (if API is enabled) that user updated their hand raised.
|
||||||
|
*
|
||||||
|
* @param {string} id - User id.
|
||||||
|
* @param {boolean} handRaised - Whether user has raised hand.
|
||||||
|
* @returns {void}
|
||||||
|
*/
|
||||||
|
notifyRaiseHandUpdated(id: string, handRaised: boolean) {
|
||||||
|
this._sendEvent({
|
||||||
|
name: 'raise-hand-updated',
|
||||||
|
handRaised,
|
||||||
|
id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disposes the allocated resources.
|
* Disposes the allocated resources.
|
||||||
*
|
*
|
||||||
|
|
|
@ -79,6 +79,7 @@ const events = {
|
||||||
'participant-role-changed': 'participantRoleChanged',
|
'participant-role-changed': 'participantRoleChanged',
|
||||||
'password-required': 'passwordRequired',
|
'password-required': 'passwordRequired',
|
||||||
'proxy-connection-event': 'proxyConnectionEvent',
|
'proxy-connection-event': 'proxyConnectionEvent',
|
||||||
|
'raise-hand-updated': 'raiseHandUpdated',
|
||||||
'video-ready-to-close': 'readyToClose',
|
'video-ready-to-close': 'readyToClose',
|
||||||
'video-conference-joined': 'videoConferenceJoined',
|
'video-conference-joined': 'videoConferenceJoined',
|
||||||
'video-conference-left': 'videoConferenceLeft',
|
'video-conference-left': 'videoConferenceLeft',
|
||||||
|
|
|
@ -448,6 +448,10 @@ function _raiseHandUpdated({ dispatch, getState }, conference, participantId, ne
|
||||||
raisedHand
|
raisedHand
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
if (typeof APP !== 'undefined') {
|
||||||
|
APP.API.notifyRaiseHandUpdated(participantId, raisedHand);
|
||||||
|
}
|
||||||
|
|
||||||
if (raisedHand) {
|
if (raisedHand) {
|
||||||
dispatch(showNotification({
|
dispatch(showNotification({
|
||||||
titleArguments: {
|
titleArguments: {
|
||||||
|
|
|
@ -470,6 +470,7 @@ class Toolbox extends Component<Props, State> {
|
||||||
*/
|
*/
|
||||||
_doToggleRaiseHand() {
|
_doToggleRaiseHand() {
|
||||||
const { _localParticipantID, _raisedHand } = this.props;
|
const { _localParticipantID, _raisedHand } = this.props;
|
||||||
|
const newRaisedStatus = !_raisedHand;
|
||||||
|
|
||||||
this.props.dispatch(participantUpdated({
|
this.props.dispatch(participantUpdated({
|
||||||
// XXX Only the local participant is allowed to update without
|
// XXX Only the local participant is allowed to update without
|
||||||
|
@ -480,8 +481,10 @@ class Toolbox extends Component<Props, State> {
|
||||||
|
|
||||||
id: _localParticipantID,
|
id: _localParticipantID,
|
||||||
local: true,
|
local: true,
|
||||||
raisedHand: !_raisedHand
|
raisedHand: newRaisedStatus
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
APP.API.notifyRaiseHandUpdated(_localParticipantID, newRaisedStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue