@@ -5,6 +5,7 @@ import { deserializeCsv } from '../../utils/comma-separated';
55import { debounce } from '../../utils/debounce' ;
66import { stringToArray } from '../../utils/stringToArray' ;
77import { UploadSource } from '../../utils/UploadSource' ;
8+ import { EventType } from '../UploadCtxProvider/EventEmitter' ;
89import './camera-source.css' ;
910import { CameraSourceEvents , CameraSourceTypes } from './constants' ;
1011
@@ -174,12 +175,28 @@ export class CameraSource extends UploaderBlock {
174175 this . historyBack ( ) ;
175176 } ,
176177
177- onShot : ( ) => this . _shot ( ) ,
178+ onShot : ( ) => {
179+ this . emit ( EventType . ACTION_EVENT , {
180+ metadata : {
181+ event : 'shot-camera' ,
182+ node : this . tagName ,
183+ } ,
184+ } ) ;
185+ this . _shot ( ) ;
186+ } ,
178187
179188 onRequestPermissions : ( ) => this . _capture ( ) ,
180189
181190 /** General method for photo and video capture */
182- onStartCamera : ( ) => this . _chooseActionWithCamera ( ) ,
191+ onStartCamera : ( ) => {
192+ this . emit ( EventType . ACTION_EVENT , {
193+ metadata : {
194+ event : 'start-camera' ,
195+ node : this . tagName ,
196+ } ,
197+ } ) ;
198+ this . _chooseActionWithCamera ( ) ;
199+ } ,
183200
184201 onStartRecording : ( ) => this . _startRecording ( ) ,
185202
@@ -189,9 +206,25 @@ export class CameraSource extends UploaderBlock {
189206
190207 onToggleAudio : ( ) => this . _toggleEnableAudio ( ) ,
191208
192- onRetake : ( ) => this . _retake ( ) ,
209+ onRetake : ( ) => {
210+ this . emit ( EventType . ACTION_EVENT , {
211+ metadata : {
212+ event : 'retake-camera' ,
213+ node : this . tagName ,
214+ } ,
215+ } ) ;
216+ this . _retake ( ) ;
217+ } ,
193218
194- onAccept : ( ) => this . _accept ( ) ,
219+ onAccept : ( ) => {
220+ this . emit ( EventType . ACTION_EVENT , {
221+ metadata : {
222+ event : 'accept-camera' ,
223+ node : this . tagName ,
224+ } ,
225+ } ) ;
226+ this . _accept ( ) ;
227+ } ,
195228
196229 onClickTab : ( event : MouseEvent ) => {
197230 const target = event . currentTarget as HTMLElement | null ;
0 commit comments