Methods

Describes the JavaScript methods to load and play animation in the Lottie-Vue component.

Use the following JavaScript methods to load and play animations using the Lottie-Vue component.

Lottie-Vue Methods

Method: togglePlayPause()

Purpose: Toggles between playing and pausing the animation.

Return Type: void

-----------------------------------------------

Method: toggleFullscreen()

Purpose: Toggles between using the player in full-screen mode and in minimal mode.

Parameters: None

Return Type: void

--------------------------------------------------------

Method: toggleLoop()

Purpose: Toggles animation looping. If the looping is set to true, toggleLooping() sets it to false, and vice versa.

Parameter: None

Return Type: void

--------------------------------------------------------

Method: getVersions()

Purpose: Returns the version of lottie-web used, as well as the current player's version.

Return Type: { lottieWebVersion: string, lottiePlayerVersion: string, lottieVuePlayerVersion: string }

--------------------------------------------------------

Method: setPlayerSpeed(value?: number)

Purpose: Sets the animation playback speed.

Parameters:

NameTypeDescription

value

number

Playback speed. The value must be any positive integer. The default value is 1.

Return Type: void

--------------------------------------------------------

Method: stop()

Purpose: Stops animation play.

Parameter: None

Return Type: void

--------------------------------------------------------

Method: setBackgroundColor(color: string)

Purpose: Sets the background color.

Parameters:

NameTypeDescription

color

string

An RGB color value.

Return Type: void

Last updated