Skip to main content

Store video and document

This guide will show you how to store the references to the video and document when they have been uploaded and saved.

Complete event

After the initialization you are left with an instance of the annotation tool which you can use to listen for events. The complete event will contain the references to the document and video.

annotation.on('complete', (data) => {
const { recordings, documents } = data;
const [ document ] = documents;
const [ video ] = recordings ?? [null];

const documentReference = document.uuid; // save this
const videoReference = video ? video.uuid : null; // save this (if not null)
});
caution

In order to read the documents or stream the videos after creation - you *** NEED *** to store the references to the videos and documents in your own system.

Data object

This example will show you how the data object is structured.

{
"recordings": [
{
"name": "recording_14.mp4",
"uuid": "a31c671d-d90d-43a6-ba5d-f590c1fcbda6"
}
],
"documents": [
{
"name": "example_4.pdf",
"uuid": "93b1dc3e-255c-4911-8170-bee61dfdf814"
}
]
}

The video recording part of the annotation tool is optional for the user. This means that the data object can come without an recordings array. This will look something like this:

{
"documents": [
{
"name": "example_4.pdf",
"uuid": "93b1dc3e-255c-4911-8170-bee61dfdf814"
}
]
}