...
As you can see in the code, once the event is received, we double check to action just for the final video_approved event, when we finally close the popup of a quick action.
This is a simple example, but any custom logic can be built just listening to events and leveraging the data specified alongside them.
The full list of events, by "eventType" are:
- video_initialised: the video recorder component has been initialised on the hosting page
- video_access_forbidden: the camera has not been granted access to
- video_access_granted: the camera has been granted access to
- video_recording: the recording has started
- video_stop_recording: the recording has been stopped
- video_uploading: the uploading has started
- video_uploading_progress (info on how much it has been uploaded vs the total amount): the upload is in progress
- video_uploaded: the upload has been completed
- video_verified: the video has been verified (we recommend to listen to this even before destroying the recorder component or moving to another page)
- video_processed: the media backend confirms that the processing has been completed
- video_rerecord: the user has selected to retake the recording
- video_approved: the user has approved this video
- video_vault: the video has been selected from the video vault
The VideoRecordingEvent specifies the following attributes:
- eventType, to define which type of event this is
- videoExternalId, identifier of the video on the media server
- videoId, Salesforce ID of the video
- referenceRecordId, Salesforce ID of the record associated with this video
- vaultId, Salesforce ID of the video vault used to create this video
- videoUploaded, how much has been uploaded so far
- videoTotal, total size of this video
- containerDomId, identifier of the element in the HTML that hosts this instance of the video recorder
Conclusion & Next Steps
In this section we have hopefully made more clear the process followed by each video, from the upload onwards. We have then discovered how to listen and react to these events, directly from your own Lightning component. In the next section we will wrap up the advanced section for the recording component, listing all the available parameters.
...