Options

Every option the video editor accepts.

Every option of the video editor. With React, each option is a prop of VideoEditor. With the custom element or mountVideoEditor, each option is a key of props, and text options can also be attributes, such as license-key for licenseKey.

TypeScript names the type VideoEditorProps, and VideoEditorReactProps for the React component.

Address security

Use HTTPS for every server and remote media address you pass to the editor. The only HTTP exceptions are http://localhost, http://127.0.0.1 and http://[::1], for development on your own computer. Relative paths and storage keys must resolve to an HTTPS address outside local development.

Hosted requests that carry your license key, including hosted captions, are refused over HTTP to another computer. For other addresses, HTTPS is the integration rule; the SDK does not enforce it on every option.

This rule also applies to addresses in templates, stock results and callback requests. The former proxyUrl option follows the same rule; use endpointUrl in new integrations.

Custom actions

NameTypeDefaultDescription
customActionsRead-only CustomAction[]NoneAdds host buttons to the selection controls and right-click menu. See Custom actions.
onCustomAction(event: CustomActionEvent) => voidNoneReceives started and a final run status.

Required

NameTypeDefaultDescription
licenseKeystringnoneYour license key. See License keys.
onClose() => voidnoneCalled when the user closes the editor, and after Save & Exit.

Export

NameTypeDefaultDescription
onExport(file: File, extras?) => voidnoneReceives the exported MP4, WebM, or GIF file. Without it, there is no Save & Exit. See Export.
onExportProgress(event) => voidnoneProgress of a Save & Exit export after the editor has closed, and the reason when an export is refused.
onThumbnails(delivery) => voidnoneReceives a still picture and a short clip of each export.
videoThumbnails'ask' | 'always' | 'never''ask'When thumbnails are made. Needs onThumbnails, except 'never'.
export{ experimental: boolean }noneDeprecated. Accepted, and changes nothing: every export uses the same engine.

Saving and storage

NameTypeDefaultDescription
onSaveTemplate({ template }) => Promise<void>noneStores a design or a draft. See Saving and loading.
onGetTemplates() => Promise<Template[]>noneReturns the designs for the Templates panel. Use HTTPS for remote media addresses in returned templates.
defaultTemplateTemplatenoneThe design the editor opens with. Use HTTPS for remote media addresses in the template.
defaultVideoFilenoneA video file the editor opens with.
templateCanvasPolicy'adopt' | 'fit' | 'place''adopt'What happens when a design comes from a canvas of another size.
mediaAddPolicy'fit' | 'fill' | 'none''fit'Placement of new pictures and clips: fit inside, cover the canvas, or use native pixels centered. Explicit action sizes win. Any other value is treated as 'fit', with one console warning.
templateMetadataobjectnoneYour fields for saved designs (metadata), and your brand: brands and activeBrandId, or the one-brand colors, textStyles, and logoUrl. See Brand kits. Use HTTPS for remote brand logo addresses.
onBrandChange(brandId: string) => voidnoneCalled with the id of the active brand kit when the editor opens and on every switch. See Brand kits.
onUploadAsset(file, ctx) => Promise<{ url }>noneStores media files in your storage. See Asset storage. Return an HTTPS address, or a storage key that resolves to one.
resolveAssetUrl(storedUrl, ctx) => Promise<string>noneTurns a stored reference into an address the browser can load. Resolve remote media to HTTPS.
assetMetadataRecord<string, string>noneYour own fields, added to the context of every upload.
inlineTemplateMediabooleanfalseStores media inside the design record instead of uploading it.
assetBaseUrlstringnoneThe address that stored references without http are joined to. Use an HTTPS base address.
uploadApiUrlstringnoneThe server of the older upload path. Prefer onUploadAsset. Use HTTPS.
workflowsarraynoneYour workflows for the Templates panel. See Templates.

For mediaAddImageFromUrl and mediaAddVideoFromUrl, executeAsync reads file dimensions before placing the item. That read has a 10-second limit. If it fails or reaches the limit, the item uses its previous default placement; an explicit box stays as requested. The synchronous execute does not read dimensions and ignores the file's shape. It places a picture in a fixed 300 × 300 box and a video in a fixed 400 × 300 box, both at x 100, y 100, unless you pass a box. Use executeAsync when you want the item fitted with mediaAddPolicy. This does not change an action's name or arguments.

Item locking

These options are part of item locking, which is new in @layermetry/media-editor. Item locking needs version 1.0.0 or later; versions before 1.0.0 do not have these options.

With the custom element, the attributes are editor-role, allow-unlock and default-locks. onUnlock is a function, so it can only be set in props. See Item locking in your framework guide.

NameTypeDefaultDescription
role'creator' | 'adopter' | 'viewer''adopter'Who is editing. A creator ignores locks, an adopter obeys them, and a viewer changes nothing.
allowUnlockbooleanfalseLets an adopter ask to unlock items. A creator may always unlock.
onUnlock(event) => answer, or a Promise of an answernoneCalled before every unlock. Answer false, { allowed: false } or reject to refuse it. Answer { ref } to store your audit id in the unlock record.
defaultLocksobject, for example { move: true }the design's ownReplaces the design's own default locks for this session. A save never writes it.

Servers and media

NameTypeDefaultDescription
mediaApiUrlstringnoneYour media server: speech to text, background removal, stabilization, and the assistant chat. Use HTTPS.
stockMediaApisobjectnonePexels, Unsplash, and Freesound. See Stock media. Use HTTPS for provider endpoints and returned media addresses.
showAttributionOverlaybooleanfalseThe starting value of Show photo credits on the canvas in the Export panel. See Photo credits.
includeAttributionInExportbooleanfalseThe starting value of Include photo credits in the export.
stickers{ sources: StickerSource[] }the built-in setThe sticker sources. See Stickers and GIFs. Use HTTPS for remote source and sticker addresses.
googleFonts{ hosted: true } | { endpointUrl } | { requestFn }Built-in familiesWhere the font picker gets the whole Google Fonts catalog. See Fonts. Use HTTPS for a custom endpoint.
googleFontsApiKeystringnoneDeprecated. Sends your Google key from the browser. Use googleFonts.

AI

Configure generation through ai; expose developer tests separately with showAiPlayground.

NameTypeDefaultDescription
aiEditorAIConfigNoneConfigures transport, operations and hooks.
ai.endpointUrlstringNoneSends requests to your server without the SDK license header. Use HTTPS.
ai.requestFnAIRequestFunctionNonePasses a request and AbortSignal to your callback. Use HTTPS for requests made by your callback.
ai.hostedtrueNoneComing soon. Available only with an enterprise licence from Layermetry. Use your own endpointUrl or requestFn.
ai.headersAIHeaderValues or AIHeadersFunctionNoneSupplies same-origin endpoint headers before each attempt.
ai.credentialsomit, same-origin or includesame-originSets endpoint request cookie behavior.
ai.timeoutMsnumberNoneLimits submission time with your endpoint or function.
ai.maxRetriesnumber0Sets extra endpoint attempts with an idempotency header.
ai.idempotencyKeyHeaderstringNoneNames the server header used with positive maxRetries.
ai.brandfalse or { addToPrompt?, operations? }Brand onControls the Use brand switch in the Generate boxes. false removes it. See Brand kits.
ai.limits{ maxPerSession?: number }UnlimitedCaps attempts across operations in a session.
ai.textBoolean or operation optionsEnabled with usable AIConfigures text independently.
ai.textRewriteBoolean or operation optionsEnabled with usable AIConfigures textRewrite independently.
ai.imageBoolean or operation optionsEnabled with usable AIConfigures image independently.
ai.imageEditBoolean or operation optionsEnabled with usable AIConfigures imageEdit independently.
ai.stickerBoolean or operation optionsEnabled with usable AIConfigures sticker independently.
ai.svgPathBoolean or operation optionsEnabled with usable AIConfigures svgPath independently.
ai.videoBoolean or operation optionsEnabled with usable AIConfigures video independently.
ai.imageToVideoBoolean or operation optionsEnabled with usable AIConfigures imageToVideo independently.
ai.captionsBoolean or operation optionsControls visibleConnect transcription with transport, or set mediaApiUrl. No audio is sent without a host destination. false hides the controls. Use HTTPS for the captions endpoint.
ai.voiceBoolean or operation optionsEnabled with usable AIConfigures voice independently.
ai.musicBoolean or operation optionsEnabled with usable AIConfigures music independently.
ai.soundEffectBoolean or operation optionsEnabled with usable AIConfigures soundEffect independently.
ai.onGenerationErrorAIGenerationErrorObserverNoneObserves one failure per attempt.
ai.onGenerationEventAIGenerationEventObserverNoneObserves generation lifecycle events.
ai.errorMessagesAIErrorWordingByCategorySDK wordingReplaces error wording by category.
ai.supportUrlHTTPS stringNoneAdds Contact support on account and transport failures. Use HTTPS.
showAiPlaygroundbooleanfalseAdds AI testing to the developer Studio.
templateGenerationTemplateGenerationConfigNoneConfigures generation of complete templates through a separate callback.

Choose exactly one transport. headers, credentials and retries require endpointUrl. With requestFn, only timeoutMs is accepted. The former proxyUrl name is not supported.

Operations share models, defaultModel, providers, transport and maxPerSession. Choose either models or providers. See AI providers for defaults, fields and restrictions.

Recording

NameTypeDefaultDescription
recordingRecordingConfignoneDefaults for the voiceover recorder. See Microphone recording.
recording.countdownSeconds0 | 3 | 53The countdown before recording starts. 0 is no countdown.
recording.cleanUpNoisebooleanfalseTicks Clean up noise by default.
recording.uploadAllTakesbooleanfalseSends every take to onUploadAsset, each with ctx.take.
recording.scriptstringnoneThe words for the prompter, at most 20,000 characters. A new value replaces the current script.
recording.preRollSecondsnumber2How long the video plays before the range when the user re-records part of a clip. From 0 to 10.

The user's own choices in the recorder win over these defaults, unless a ui.features switch hides the choice. A value that is not allowed is ignored, with one warning in the console.

Look and layout

NameTypeDefaultDescription
themePartial<Record<SemanticRole, string>>the Layermetry paletteColors by role name. See Theming.
darkModebooleanby container widthtrue for the dark theme, false for the light theme.
enableThemeTogglebooleanfalseAdds a light and dark switch to the app bar.
showThemeCreatorbooleanfalsetrue shows the palette button that opens the Customization Studio. Any other value hides it. See Editor settings.
typography{ heading, body, mono }the built-in fontsFonts of the editor's panels and buttons.
radii{ sm, md, lg, full }the built-in roundingCorner rounding of the editor's panels and buttons.
logostringnoneThe address of a square logo for the app bar. Use HTTPS for the logo address.
iconsIcon-name mapBuilt-in iconsAccepts IconData or React components; see Editor settings.
uiUiConfignoneHides, reorders, and renames tools, and places AI controls. See UI customization.
ui.selectionItemListConfigThe default listsHides, orders, labels and chooses display for the controls of the selected item. Applied after the default lists, on the desktop bar and on the phone.
ui.toolbarItemListConfigNoneOlder setting for toolbar groups. Its group ids are translated into control ids, with one console warning. Use ui.selection instead.
ui.customActions.shownCustomActionsUiConfig["shown"]Surface countsSets custom-action overflow counts within their maximums.
itemActionsobject or falsethe default actionsThe menu of a selected item in the compact layout.
width, heightnumber or string100%With React: the size of the component's box. With the custom element: the size of the editor inside the element.

Preferences

NameTypeDefaultDescription
preferencesobjectnoneStarting values for the user's preferences. They win over values stored in the browser.
onPreferenceChange(key, value, all) => voidnoneCalled on every change of a preference.

License

NameTypeDefaultDescription
apiUrlstringhttps://api.layermetry.com/socialThe license server. Use HTTPS.
statusUrlstringnoneSigned status files, read when the license server cannot be reached. Use HTTPS.
onLicenseState(report) => voidnoneEach change of the license state. See License validation.
renderLicenseBlocked(state) => ReactNodethe default screenYour own screen when the license is refused.

Preview

NameTypeDefaultDescription
player{ experimental: boolean }the default preview{ experimental: true } turns on the newer preview engine. It is still in development.

On this page