Search Docs
Loading...
Skip to content

Video Timeline

The video timeline is the editor’s playback and arrangement surface. In this guide we will see how to use the Feature, Component Order, and Actions APIs and engine settings to customize the video timeline.

Video timeline customization showing a multi-track layout, an always-visible transition control, a fixed-height timeline, and a custom Rewind button

10 mins
estimated time
Download
StackBlitz
GitHub

CE.SDK allows you to customize the timeline at runtime: toggle the visibility of the timeline and its buttons, customize the controls bar and its height behavior, and more. The Overview below lists each customization point.

Overview#

The timeline is customized through four APIs, each covered in its own section below:

  • Enable / Disable — switch the timeline and its individual parts on or off through the ly.img.video.timeline feature and its options.
  • Order Component APIs — order, add, and remove the timeline buttons through the Component Order API on the ly.img.video.timeline.controls.bar area.
  • Customization Actions — set a fixed height, cap the maximum height or restore the content-hugging default through the timeline.setHeight action.
  • Feature Settings — control track and transition visibility through the trackVisibility setting of ly.img.video.timeline and the controlVisibility setting of ly.img.transitions.

Enable / Disable#

The timeline is one feature, ly.img.video.timeline, with an option for each part. Switch the feature off to hide the whole timeline, or switch single options off for finer-grained control. See Disable or Enable Features.

// The timeline is one feature with an option per part. The video editor
// config switches it on; switch an option off to hide just that part.
cesdk.features.configure({
'ly.img.video.timeline': {
enabled: true,
options: { overlays: { enabled: true } }
}
});

Each option toggles a specific part of the timeline:

Option Controls
ruler The time ruler above the tracks
clips Clip editing on the tracks
clips > addClip The add clip button below the tracks
audio The audio track
overlays Overlay tracks
clip > expand The expand button on group clips
clip > split The split control
controls The controls bar
playback The play/pause control
playback > loop The loop control
zoom The zoom control

The expand/collapse control and the background color control are components of the controls bar, not options. Show or hide them with the Component Order API (ly.img.video.timeline.toggle and ly.img.video.timeline.background). The items of the per-clip context menu follow the features they stand for, such as ly.img.delete, ly.img.duplicate and ly.img.replace.

Order Component APIs#

The controls bar holds the timeline’s buttons — play/pause, split, loop, zoom, and so on. It is a Component Order API area identified by ly.img.video.timeline.controls.bar, and it is gated by the controls option of the timeline feature. You register custom components and set the order the same way as for the dock or inspector bar.

First register a custom Rewind button with registerComponent. The builder’s Button takes a label, an icon, and a click handler that seeks playback back to the start.

// Register a custom Rewind button that jumps playback back to the start.
cesdk.ui.registerComponent(
'ly.img.video.timeline.rewind',
({ builder }) => {
builder.Button('rewind', {
label: 'Rewind',
icon: '@imgly/Repeat',
onClick: () => {
engine.block.setPlaybackTime(page, 0);
}
});
}
);

The video editor config already sets a default controls bar order, so you can adjust it in place instead of replacing the whole order. We add the Rewind button to the front with insertOrderComponent and remove the loop control with removeOrderComponent.

// The video editor config already sets a default controls bar order. Add
// the Rewind button to the front and remove the loop control.
cesdk.ui.insertOrderComponent(
{ in: 'ly.img.video.timeline.controls.bar', position: 'start' },
'ly.img.video.timeline.rewind'
);
cesdk.ui.removeOrderComponent({
in: 'ly.img.video.timeline.controls.bar',
match: 'ly.img.video.timeline.loop'
});

Built-in Component IDs#

These IDs are available for the controls bar order, in addition to any custom components you register.

Component ID Description
ly.img.separator Visual divider between components
ly.img.spacer Flexible space that pushes components apart
ly.img.video.timeline.background Timeline background color button
ly.img.video.timeline.split Split the selected clip at the playhead
ly.img.video.timeline.playbackInfo Current time and total duration readout
ly.img.video.timeline.playPause Play/pause toggle
ly.img.video.timeline.loop Loop toggle
ly.img.video.timeline.zoom Timeline zoom controls
ly.img.video.timeline.toggle Expand/collapse the timeline

Add Clip Button#

Below the tracks, the timeline shows an “Add Clip” button that runs the built-in addClip action. The button is the addClip option inside the clips option of the timeline feature. Register your own addClip action to control what it opens — here we open the asset library filtered to image and video sources.

// The "Add Clip" button below the tracks runs the built-in `addClip`
// action. Toggle the button with its option, or register your own action
// to change what the button does.
cesdk.features.configure({
'ly.img.video.timeline': {
options: { clips: { options: { addClip: { enabled: true } } } }
}
});
cesdk.actions.register('addClip', () => {
cesdk.ui.openPanel('//ly.img.panel/assetLibrary', {
payload: {
entries: ['ly.img.image', 'ly.img.video'],
applyAssetContext: { clipType: 'clip' }
}
});
});

Use a custom action to open your own source, an upload flow, or a dialog instead of the default asset library.

Customization Actions#

The timeline’s height is set through the timeline.setHeight action. It accepts a settings object with a height (a value in pixels or 'auto') and a maxHeight in pixels.

// Give the timeline a fixed 320px height. Pass { height: 'auto' } to
// restore the content-hugging default, or add maxHeight to cap how tall
// the auto-growing timeline may get.
await cesdk.actions.run('timeline.setHeight', { height: 320 });

By default the timeline grows and shrinks to hug its content. Passing a number as height fixes the timeline at that height, while 'auto' restores the default content-hugging behavior, which starts at 30% of the editor viewport height. Passing a number as maxHeight caps how tall the timeline may get — both when it grows with its content and when it is resized by hand — replacing the built-in limit, so a larger value also allows a taller timeline. In both modes the drag-to-resize handle stays available — dragging sets a manual height, and double-clicking the handle resets it. A later timeline.setHeight call with a height replaces a manual height.

Feature Settings#

Two feature settings control timeline visibility. Set them through cesdk.features.configure.

Track Visibility#

The timeline can show all tracks in the scene or collapse to a single row that follows the active track. Set trackVisibility of ly.img.video.timeline to 'all' for the full multi-track view, the default, or 'active' for the simplified view.

// Show every track in the timeline. 'active' collapses the timeline to a
// single row showing only the selected track's clips.
cesdk.features.configure({
'ly.img.video.timeline': { trackVisibility: 'all' }
});

In our example the scene has a video track and a separate audio track, so 'all' renders both rows. The 'active' value is useful for a compact editor where only the selected track’s clips matter.

Transition Controls#

When two clips sit next to each other on a track, the timeline shows a control between them for editing the transition. By default it appears on hover. Set controlVisibility of ly.img.transitions to 'always' to keep it visible at all times.

// Keep the transition control between adjacent clips permanently visible
// instead of revealing it only on hover.
cesdk.features.configure({
'ly.img.transitions': { controlVisibility: 'always' }
});

The control still hides on “tight” seams where there is no room to draw it. Our example assigns a cross-fade between the first two clips, so the always-visible control has something to render. For creating and configuring the transitions themselves, see Apply Transitions.

API Reference#

Method Purpose
cesdk.features.configure({ 'ly.img.video.timeline': { enabled: true } }) Switch the timeline and its options on or off
cesdk.features.configure({ 'ly.img.video.timeline': { trackVisibility } }) Show all tracks ('all') or the active one ('active')
cesdk.features.configure({ 'ly.img.transitions': { controlVisibility } }) Show transition controls on 'hover' or 'always'
cesdk.actions.run('timeline.setHeight', settings) Set a fixed timeline height and/or a maxHeight cap
cesdk.ui.registerComponent(ids, renderComponent) Register a custom controls bar component
cesdk.ui.setComponentOrder({ in: 'ly.img.video.timeline.controls.bar' }, order) Set the controls bar order
cesdk.ui.getComponentOrder({ in: 'ly.img.video.timeline.controls.bar' }) Read the current controls bar order
cesdk.ui.insertOrderComponent({ in: 'ly.img.video.timeline.controls.bar' }, c) Insert components into the controls bar
cesdk.ui.removeOrderComponent({ in: 'ly.img.video.timeline.controls.bar' }) Remove components from the controls bar
cesdk.actions.run('addClip') Run the built-in add clip action
cesdk.actions.register('addClip', handler) Replace the add clip action behavior
cesdk.features.configure({ 'ly.img.video.timeline': { options: { clips: { options: { addClip: { enabled: true } } } } } }) Show or hide the add clip button

Next Steps#

Each API used here is covered in depth in its own guide:

  • Features API — switch on, switch off, and conditionally toggle editor features.
  • Component Order API — order, insert, update, and remove components in any UI area.
  • Actions API — run and register built-in and custom actions.