Use CE.SDK to flip videos horizontally or vertically in your Android app. This guide covers how to mirror video elements, flip multiple items, and control flipping behavior through templates.
What you’ll learn#
- Flip a video horizontally or vertically
- Use flipping in template design or creative workflows
- Reset or toggle flip programmatically
When to use#
Flipping is helpful when:
- Mirroring product videos for layout consistency
- Creating stylistic reflections or duplicates
- Aligning elements in symmetrical designs
Flip horizontally or vertically#
Use the flip/horizontal and flip/vertical properties to control mirroring. They are boolean properties and have helper functions defined. All flips are around the center point of a block.
engine.block.setFlipVertical(videoBlock, true)engine.block.setFlipHorizontal(videoBlock, true)
To determine if a block has been flipped you can query the properties or use helper functions.
val isFlippedVertical = engine.block.getFlipVertical(videoBlock)val isFlippedHorizontal = engine.block.getFlipHorizontal(videoBlock)Toggle flipping#
To toggle the flip state:
val currentVerticalFlip = engine.block.getFlipVertical(videoBlock)engine.block.setFlipVertical(videoBlock, !currentVerticalFlip)
val currentHorizontalFlip = engine.block.getFlipHorizontal(videoBlock)engine.block.setFlipHorizontal(videoBlock, !currentHorizontalFlip)Reset flipping#
To reset all flips:
engine.block.setFlipVertical(videoBlock, false)engine.block.setFlipHorizontal(videoBlock, false)Flip multiple elements#
Group elements to flip them together:
val groupId = engine.block.group(listOf(videoBlock, textBlock))engine.block.setFlipHorizontal(groupId, true)