Lottie Player
The Lottie Player enables the playback of animations that are in the Lottie format. This format is basically a JSON-based animation file format that allows the creation of vector animations, which are scalable and easily transferrable across platforms and devices. Thus, the Lottie Payer makes it easy to incorporate complex animations into your applications.
Lottie Player Properties
Property | Description |
---|---|
URL | Enter the URL of the Lottie file |
API Methods
setVisibility
Sets the Visibility flag for this component.
- Method
- Usage
setVisibility(visible: boolean): void
// Setting the visibility to "true" makes the element visible
a8forms.Lottie("lottieId").setVisibility(true)
// Setting the visibility to "false" makes the element invisible
a8forms.Lottie("lottieId").setVisibility(false)
setVisibilityCondition
Sets the visibility condition for this component.
- Method
- Usage
setVisibilityCondition(condition: string): void
// Sets a condition for changing the element's visibility status.
a8forms.Lottie("lottieId").setVisibilityCondition("1 === 1")
Event Handlers
Event handlers allow you to set triggers for various actions based on the fired events. They are as follows:
onPlay
onPlay
- Sets the actions to be performed when the Lottie media begins to play. For example, you can display a message or change the appearance of the player controls.
onComplete
onComplete
- Sets the actions to be performed when the Lottie media file has completed playing. For example, you can have the app display a form or a landing screen after the Lottie file has finished playing.
onClick
onClick
- Sets the actions to be triggered when the component is clicked.