feat(face-landmarks) add API event for providing face landmark data (#11347)

This commit is contained in:
Avram Tudor 2022-04-08 10:12:38 +03:00 committed by GitHub
parent ae6454c59c
commit ceb8d3348d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 0 deletions

View File

@ -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.
*

View File

@ -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',

View File

@ -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'];