Ver código fonte

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

master
Avram Tudor 3 anos atrás
pai
commit
ceb8d3348d
Nenhuma conta vinculada ao e-mail do autor do commit

+ 15
- 0
modules/API/API.js Ver arquivo

1141
         });
1141
         });
1142
     }
1142
     }
1143
 
1143
 
1144
+    /**
1145
+     * Notify external application (if API is enabled) that some face landmark data is available.
1146
+     *
1147
+     * @param {Object | undefined} faceBox - Detected face(s) bounding box (left, right, width).
1148
+     * @param {string} faceExpression - Detected face expression.
1149
+     * @returns {void}
1150
+     */
1151
+    notifyFaceLandmarkDetected(faceBox: Object, faceExpression: string) {
1152
+        this._sendEvent({
1153
+            name: 'face-landmark-detected',
1154
+            faceBox,
1155
+            faceExpression
1156
+        });
1157
+    }
1158
+
1144
     /**
1159
     /**
1145
      * Notify external application (if API is enabled) that the list of sharing participants changed.
1160
      * Notify external application (if API is enabled) that the list of sharing participants changed.
1146
      *
1161
      *

+ 1
- 0
modules/API/external/external_api.js Ver arquivo

102
     'email-change': 'emailChange',
102
     'email-change': 'emailChange',
103
     'error-occurred': 'errorOccurred',
103
     'error-occurred': 'errorOccurred',
104
     'endpoint-text-message-received': 'endpointTextMessageReceived',
104
     'endpoint-text-message-received': 'endpointTextMessageReceived',
105
+    'face-landmark-detected': 'faceLandmarkDetected',
105
     'feedback-submitted': 'feedbackSubmitted',
106
     'feedback-submitted': 'feedbackSubmitted',
106
     'feedback-prompt-displayed': 'feedbackPromptDisplayed',
107
     'feedback-prompt-displayed': 'feedbackPromptDisplayed',
107
     'filmstrip-display-changed': 'filmstripDisplayChanged',
108
     'filmstrip-display-changed': 'filmstripDisplayChanged',

+ 4
- 0
react/features/face-landmarks/actions.js Ver arquivo

28
 } from './functions';
28
 } from './functions';
29
 import logger from './logger';
29
 import logger from './logger';
30
 
30
 
31
+declare var APP: Object;
32
+
31
 /**
33
 /**
32
  * Object containing  a image capture of the local track.
34
  * Object containing  a image capture of the local track.
33
  */
35
  */
125
                     id: localParticipant.id
127
                     id: localParticipant.id
126
                 });
128
                 });
127
             }
129
             }
130
+
131
+            APP.API.notifyFaceLandmarkDetected(faceBox, faceExpression);
128
         };
132
         };
129
 
133
 
130
         const { faceLandmarks } = getState()['features/base/config'];
134
         const { faceLandmarks } = getState()['features/base/config'];

Carregando…
Cancelar
Salvar