The player implementation as a wrapper around lottie-web.

Main purposes:

  • Provides simple API to control animation and customize icon properties on the fly.
  • Allows to react on the animation life cycle.
  • Separate integration with lottie-web from our custom element. That way, the player can potentially work without a custom element.
  • Simplifies custom element implementation.
  • Simplifies testing.

Hierarchy

  • Player

Implements

Constructors

Accessors

  • get colors(): null | IColors
  • This property allows you to discover customizable colors or update them within a processed icon.

    Example (list all supported colors by the icon):

    { ...iconElement.playerInstance.colors }
    

    Example (update a single color):

    iconElement.playerInstance.colors.primary = '#ff0000';
    

    Example (update multiple colors at once):

    iconElement.playerInstance.colors = { primary: 'red', secondary: 'blue' };
    

    Example (reset all colors to default):

    iconElement.playerInstance.colors = null;
    

    Returns null | IColors

  • set colors(colors): void
  • This property allows you to discover customizable colors or update them within a processed icon.

    Example (list all supported colors by the icon):

    { ...iconElement.playerInstance.colors }
    

    Example (update a single color):

    iconElement.playerInstance.colors.primary = '#ff0000';
    

    Example (update multiple colors at once):

    iconElement.playerInstance.colors = { primary: 'red', secondary: 'blue' };
    

    Example (reset all colors to default):

    iconElement.playerInstance.colors = null;
    

    Parameters

    Returns void

  • get direction(): AnimationDirection
  • The 'direction' property lets you influence the direction of the animation playback, whether it plays forward (1) or in reverse (-1).

    Returns AnimationDirection

  • set direction(direction): void
  • The 'direction' property lets you influence the direction of the animation playback, whether it plays forward (1) or in reverse (-1).

    Parameters

    • direction: AnimationDirection

    Returns void

  • get state(): null | string
  • This property allows you to control the state (motion type) of the icon. States enable switching between multiple animations built into a single icon file.

    Returns null | string

  • set state(state): void
  • This property allows you to control the state (motion type) of the icon. States enable switching between multiple animations built into a single icon file.

    Parameters

    • state: null | string

    Returns void

Methods