Lottie with code in EditorX

Hey all - I have been having some issues with assigning code to a lottie objects.

In a nutshell, not all functions work. E.g. .stop() and pause() have no effect on the lottie object.

My ultimate goal is to have a Lottie object on stop, untill it scrolled into the viewport.

Considering, some other functions on the same lottie object do work, I wonder if I am missing a library to import. Does anyone know why stop() doesnt work with this example?:

import wixAnimations from 'wix-animations';
import wixWindow from 'wix-window';

$w.onReady(function () {
  
    //Lottie does not play yet by default
    $w('#lottieExample').stop();
}

And for reference, this is how I plan to make it play OnViewportEnter once I have the .stop() working (outside of OnReady):

$w("#lottieExample").onViewportEnter( (event) => {
$w('#lottieExample').play();
});

Any help would be appreciated, thank you.

i am wondering the same thing. anyone?

If anyone is still struggling with the same issue; I have been on contact with support and it turns out that the stop() function for Lottie is currently not working for now, unless if you place it in an event handler.

That means that nameOfYourLottie.stop(); won’t work in the root of onRead();, but only if you use an event handler, such as onViewPortEnter.

Support mentioned they are working on getting the issue solved, but for now this is the way to go forward!