feat(face-landmarks) add API event for providing face landmark data (#11347)
This commit is contained in:
parent
ae6454c59c
commit
ceb8d3348d
|
@ -1141,6 +1141,21 @@ class API {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify external application (if API is enabled) that some face landmark data is available.
|
||||
*
|
||||
* @param {Object | undefined} faceBox - Detected face(s) bounding box (left, right, width).
|
||||
* @param {string} faceExpression - Detected face expression.
|
||||
* @returns {void}
|
||||
*/
|
||||
notifyFaceLandmarkDetected(faceBox: Object, faceExpression: string) {
|
||||
this._sendEvent({
|
||||
name: 'face-landmark-detected',
|
||||
faceBox,
|
||||
faceExpression
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify external application (if API is enabled) that the list of sharing participants changed.
|
||||
*
|
||||
|
|
|
@ -102,6 +102,7 @@ const events = {
|
|||
'email-change': 'emailChange',
|
||||
'error-occurred': 'errorOccurred',
|
||||
'endpoint-text-message-received': 'endpointTextMessageReceived',
|
||||
'face-landmark-detected': 'faceLandmarkDetected',
|
||||
'feedback-submitted': 'feedbackSubmitted',
|
||||
'feedback-prompt-displayed': 'feedbackPromptDisplayed',
|
||||
'filmstrip-display-changed': 'filmstripDisplayChanged',
|
||||
|
|
|
@ -28,6 +28,8 @@ import {
|
|||
} from './functions';
|
||||
import logger from './logger';
|
||||
|
||||
declare var APP: Object;
|
||||
|
||||
/**
|
||||
* Object containing a image capture of the local track.
|
||||
*/
|
||||
|
@ -125,6 +127,8 @@ export function loadWorker() {
|
|||
id: localParticipant.id
|
||||
});
|
||||
}
|
||||
|
||||
APP.API.notifyFaceLandmarkDetected(faceBox, faceExpression);
|
||||
};
|
||||
|
||||
const { faceLandmarks } = getState()['features/base/config'];
|
||||
|
|
Loading…
Reference in New Issue