Table of Contents

Class SKLottiePlayer

Namespace
SkiaSharp.Extended
Assembly
SkiaSharp.Extended.dll

A platform-agnostic Skottie (Lottie) animation player that manages playback state and rendering. Can be used directly from any .NET host including .NET MAUI, Blazor, console apps, or custom renderers.

public class SKLottiePlayer
Inheritance
SKLottiePlayer
Inherited Members

Remarks

Typical usage:

  1. Create a player and set Repeat and AnimationSpeed.
  2. Call SetAnimation(Animation?) with a loaded Animation.
  3. On each frame tick, call Update(TimeSpan) with the elapsed time.
  4. Call Render(SKCanvas, SKRect) inside your paint/draw callback.

The player is not thread-safe; all calls should occur on the same thread (typically the UI thread).

Constructors

SKLottiePlayer()

Properties

AnimationSpeed

Gets or sets the playback speed multiplier. 1.0 = normal speed, 2.0 = double speed, 0.5 = half speed, negative = reverse.

Duration

Gets the total duration of the loaded animation.

HasAnimation

Gets whether an animation is currently loaded.

IsComplete

Gets whether the animation has completed all repeats.

Progress

Gets the current playback position.

Repeat

Gets or sets how the animation repeats. Defaults to Never.

Methods

Render(SKCanvas, SKRect)

Renders the current animation frame to the given canvas within the specified rectangle.

Seek(TimeSpan)

Seeks the animation to the specified position and raises AnimationUpdated. Completion and repeat logic is applied as part of the seek.

SetAnimation(Animation?)

Sets the animation to play. Pass null to clear the current animation. Resets playback state (Progress, IsComplete, repeat counters).

Update(TimeSpan)

Advances the animation by the given time delta, applying AnimationSpeed and Repeat. Call this on each frame tick.

Events

AnimationCompleted

Fires when the animation completes all repeats.

AnimationUpdated

Fires after each Seek(TimeSpan) call, notifying subscribers of updated state (Progress, Duration, IsComplete).