In order to assign descriptive metadata to media items, they need to be assigned to a metadata entity type, which will be used to store metadata.
First, we will create the media item entity type and configure it to be used on any media_container
type media items. We will call this video media
.
mutation createEntityType($input: EntityTypeInput!) {metadataCreateEntityType(input: $input) {idnameorganizationId}}
{"input": {"name":"video media","baseType": "file","baseSubType": "media_container"}}
{"data": {"metadataCreateEntityType": {"id": "e1e335c0-b24b-442f-8bba-cd4ac1af6921","name": "video media","organizationId": "73dbbfa1-3839-452e-99cf-6274cecfdfaa"}}}
We will add a metadata field to the previously created entity type and set it as the Display value
. By doing so, the metadata populated in the field that is set as Display value
will be used in Connect listings, instead of the actual file name.
You can assign a metadata field of type string
and set it as the Display name
using this mutation:
mutation createEntityAttribute($input: AttributeInput!) {metadataCreateAttribute(input: $input) {idnameentityTypeName}}
{"input": {"name":"original file name","entityTypeId": "e1e335c0-b24b-442f-8bba-cd4ac1af6921","required": true,"type": "String","attributes": {"minLength": 3,"displayName": true}}}
{"data": {"metadataCreateAttribute": {"id": "723310c3-d0c0-494e-97f3-70a6b195dc0f","name": "original file name","entityTypeName": "video media"}}}
When configuring your Connect organization to work with placeholder media (when the media has not reached Connect), you will need to define virtual assets.
First, we will create the virtual asset entity type and configure it to be compatible with any media_container
type media items.
We will create a placeholder video
virtual asset type of the media_container
type using the following mutation:
mutation createEntityType($input: EntityTypeInput!) {metadataCreateEntityType(input: $input) {idnameorganizationId}}
{"input": {"name":"Placeholder Video","baseType": "virtual_asset","baseSubType": "media_container"}}
{"data": {"metadataCreateEntityType": {"id": "9312cfed-1fde-4450-adff-202298476594","name": "Placeholder","organizationId": "73dbbfa1-3839-452e-99cf-6274cecfdfaa"}}}
We will configure a metadata field that will be used to register the location of the virtual asset. In this example it will be named as Physical location
.
mutation createEntityAttribute($input: AttributeInput!) {metadataCreateAttribute(input: $input) {idnameentityTypeName}}
{"input": {"name":"Physical location","entityTypeId": "9312cfed-1fde-4450-adff-202298476594","required": true,"type": "String","attributes": {"minLength": 3}}}
{"data": {"metadataCreateAttribute": {"id": "e1ad4149-dceb-486b-b402-ce1d6f56fb63","name": "Physical location","entityTypeName": "Placeholder Video"}}}
We will also create a File name
metadata field where we will store information about how the placeholder file is named on the external storage location.
mutation createEntityAttribute($input: AttributeInput!) {metadataCreateAttribute(input: $input) {idnameentityTypeName}}
{"input": {"name":"File name","entityTypeId": "9312cfed-1fde-4450-adff-202298476594","required": true,"type": "String","attributes": {"minLength": 3}}}
{"data": {"metadataCreateAttribute": {"id": "c8b40676-16cd-4b75-ba69-420bf976d755","name": "File name","entityTypeName": "Placeholder Video"}}}
The media JSON payload contains complex information about the media item you include. In this example, you can find the audio and video stream models that offer details about every stream in the container. For every stream, there are advanced characters such as codec, bit rate and others.
In this example, the payload contains basic details about the Show1
file in the AssetBasicData
property such as name, size, version and timecode format.
In this example, the payload contains basic details about the Show2
file in the AssetBasicData
property, as well as graphic data in the GraphicsModels
property for image file types.