Open CE.SDK with a video as the starting point for editing. The scene’s page dimensions match the video resolution and the scene is set up for time-based content.
Starting from an existing video lets you build editors for customizing video
content — trimmers, overlay editors, or upload-and-edit flows. Create a scene
from a single video with engine.scene.createFromVideo().
This guide covers creating a scene from a video and reaching the video block to adjust its properties.
Create a Scene From a Video URL#
Pass a video Uri to engine.scene.createFromVideo(). The URI can point to a
local file, a content URI, or a remote resource that your Android app can
access. The call loads the video and returns a handle to the new scene.
val videoRemoteUri = Uri.parse(SAMPLE_VIDEO_URI)val scene = engine.scene.createFromVideo(videoUri = videoRemoteUri)When you start from a video, the scene’s page dimensions match the resource, the scene uses pixel design units, and it is set up for time-based editing.
Work With the Video Block#
CE.SDK places the video inside a graphic block that carries a video fill.
Retrieve it with engine.block.findByType(DesignBlockType.Graphic), which
returns every graphic block in the scene. A scene created from a single video
contains one graphic block, so the first result is the video block. From there,
modify the block like any other element — for example, change its opacity with
engine.block.setOpacity().
// Find the automatically added graphic block in the scene that contains the video fill.val block = engine.block.findByType(type = DesignBlockType.Graphic).first()engine.block.setOpacity(block = block, value = 0.5F)See Blocks for the full Block API. The page also exposes playback state, so editor UIs can connect the same scene to trimming, seeking, and playback controls in the dedicated video guides.
API Reference#
Methods#
| Method | Description |
|---|---|
engine.scene.createFromVideo(videoUri=_) |
Create a scene from a video URI, matching the scene dimensions to the video |
engine.block.findByType(type=_) |
Find all blocks of a DesignBlockType |
engine.block.setOpacity(block=_, value=_) |
Set a block’s opacity |
Next Steps#
- Blocks — Edit blocks, layout, and properties in the scene
- Saving Scenes — Persist your scene and reload it later
- Insert Videos — Add and configure additional video blocks programmatically
- Control Audio and Video — Trim, seek, and control video and audio playback