mirror()v4.0.466
Part of the @remotion/effects package.
A mirror effect that can be applied to canvas-based components such as <Video>, <HtmlInCanvas> and <Solid>.
Example
MyComp.tsximport {AbsoluteFill } from 'remotion'; import {Video } from '@remotion/media'; import {mirror } from '@remotion/effects/mirror'; export constMyComp :React .FC = () => { return ( <AbsoluteFill > <Video src ="https://remotion.media/video.mp4"effects ={[mirror ({direction : 'horizontal',position : 0.5, }), ]} /> </AbsoluteFill > ); };
API
Pass an object with the following properties.
direction?
Mirror direction. Defaults to 'horizontal'.
'horizontal'mirrors left and right. Thepositionis interpreted on the X axis.'vertical'mirrors top and bottom. Thepositionis interpreted on the Y axis.
position?
Mirror position in UV coordinates from 0 to 1. Defaults to 0.5.
invert?
When true, mirrors the other side of the image. Defaults to false.
disabled?
When true, the effect is skipped. Defaults to false.
Requirements
mirror() uses a WebGL2 backend. During renders, enable WebGL via Config.setChromiumOpenGlRenderer() (for example 'angle'). See Using WebGL during renders.