Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
hideOnTransparent: true,
},
};
// Load the resource information
try {
const srcParsed = parseSrc(src);
const srcAttrib = typeof srcParsed === 'string' ? 'path' : 'animationData';
// Clear previous animation, if any
if (this._lottie) {
this._lottie.destroy();
}
// Initialize lottie player and load animation
this._lottie = lottie.loadAnimation({
...options,
[srcAttrib]: srcParsed
});
} catch (err) {
this.currentState = PlayerState.Error;
this.dispatchEvent(new CustomEvent(PlayerEvents.Error));
return;
}
if (this._lottie) {
// Calculate and save the current progress of the animation
this._lottie.addEventListener('enterFrame', () => {
this.seeker = (this._lottie.currentFrame / this._lottie.totalFrames) * 100;
this.dispatchEvent(new CustomEvent(PlayerEvents.Frame, {