Skip to main content

Handler function

The handler function retrieves information about your assets and return them in a format the Vev editor understands. The handler function returns an array of image or video assets.

registerVevPlugin({
handler: () => {...},
...
});

Asset types

Base asset

All asset types extends the base asset type:

export interface BaseProjectAsset {
key: string; // A unique id for the asset
mimeType: string; // The mime type of the asset (image/jpeg, video/mp4 etc.)
url: string; // The url where the Vev editor can reach the asset
filename?: string; // Optional filename
selfHosted?: boolean; // If you want to host your own asset make sure this is true
}

Image assets

export interface ProjectImageAsset extends BaseProjectAsset {
dimension?: { width: number; height: number };
thumb?: string; // A thumbnail for faster loading in the Vev editor
imageSizes?: ImageSizes; // A set of custom image sizes if you are hosting your own assets
}

Video assets

export interface ProjectVideoAsset extends BaseProjectAsset {
videoSample?: string; // A smaller video sample for faster loading in the Vev editor
videoThumbnail?: string; // A thumbnail for faster loading in the Vev editor
dimension?: { width: number; height: number };
duration?: number; // The duration of the video on seconds
additionalSources: Omit<ProjectVideoAsset, 'additionalSources'>[]; // Additional sources/formats if you are hosting your own assets
}