Introduction Welcome to the third part of the Vidispine Development Toolkit tutorial. In this part, we'll add a grid with repository items using the VdtGrid component, and show how you can preview items such as images, and video together with their metadata using VdtShape, VdtMetadata, VdtImagePreview, and VdtVideoPlayer components.
This blog post
Creating a wrapper Vue component to host the other Vue components
Creating the Items and Preview Vue components
Use VdtGrid to show existing items in the Vidispine repository
Connecting the Items and Preview Vue components
Adding the VdtShape, VdtMetadata, VdtImagePreview, VdtVideoPlayer VDT components
Getting started All the Vue components that we are going to create should be located in [my-project]/src/components. Default welcome page that is visible when we have just set up the Vidispine Development Toolkit is named VidispineVersion.vue and can be used as a learning reference.
All code can be found in the companion Github repo howto-build-vdt-applications. If you haven't set up your system yet, head over to part 1 of the tutorial, and then part 2 to learn how to build the import component.
Wrapper, Items, and Preview Start by creating a new Vue component file within the components folder. It is to be used as a wrapper so name it appropriately (we have named it Front.vue in the GitHub repo). Create two additional files, at the same level as the wrapper file, and name them Items.vue and Preview.vue. Import the import (from part 2 of the tutorial), items and preview Vue components to your wrapper component, then declare them as Vue components.
In Front.vue:
In Items.vue:
Items
In Items.vue :
In Front.vue:
In Preview.vue:
Retrieve shapes and metadata To retrieve the shapes and metadata specific to singular items, another API call has to be made. Import the itemApi function used earlier. For this specific example, the preview is expected to update as the user selects the different items in the grid. Create a new object called item that is empty by default, and assign the response from the API call to it.
In Preview.vue