LottieOverlay
@UnstableApi
class LottieOverlay : CanvasOverlay
| kotlin.Any | ||||
| ↳ | androidx.media3.effect.TextureOverlay | |||
| ↳ | androidx.media3.effect.BitmapOverlay | |||
| ↳ | androidx.media3.effect.CanvasOverlay | |||
| ↳ | androidx.media3.effect.LottieOverlay |
A CanvasOverlay that renders a Lottie animation.
This overlay uses the Lottie library to draw an animation loaded from a raw resource. The animation's size, position, speed, and looping behavior can be configured using the Builder.
Summary
Nested types |
|---|
class LottieOverlay.BuilderA builder for |
@UnstableApiProvides assets for a Lottie animation and manages their lifecycle. |
Public functions |
|
|---|---|
Unit |
Set up resources for the overlay given the input video’s dimensions. |
OverlaySettings! |
getOverlaySettings(presentationTimeUs: Long)Returns the |
synchronized Unit |
Perform custom drawing onto the |
synchronized Unit |
release()Releases all resources. |
Inherited functions |
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||
Public functions
configure
fun configure(videoSize: Size!): Unit
Set up resources for the overlay given the input video’s dimensions.
This method will be called before drawing the first frame and before drawing subsequent frames with different input dimensions.
| Parameters | |
|---|---|
videoSize: Size! |
The width and height of the input video, in pixels. |
getOverlaySettings
fun getOverlaySettings(presentationTimeUs: Long): OverlaySettings!
Returns the OverlaySettings controlling how the overlay is displayed at the specified timestamp.
| Parameters | |
|---|---|
presentationTimeUs: Long |
The presentation timestamp of the current frame, in microseconds. |
onDraw
synchronized fun onDraw(canvas: Canvas!, presentationTimeUs: Long): Unit
Perform custom drawing onto the Canvas.
release
synchronized fun release(): Unit
Releases all resources.
| Throws | |
|---|---|
androidx.media3.common.VideoFrameProcessingException |
If an error occurs while releasing resources. |