How to use the lottie-web/build/player/lottie.js.loadAnimation function in lottie-web

To help you get started, we’ve selected a few lottie-web examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chenqingspring / ng-lottie / src / lottieAnimationView.component.ts View on Github external
this._options = {
            container: this.lavContainer.nativeElement,
            renderer: this.options.renderer || 'svg',
            loop: this.options.loop !== false,
            autoplay: this.options.autoplay !== false,
            autoloadSegments: this.options.autoloadSegments !== false,
            animationData: this.options.animationData,
            path: this.options.path || '',
            rendererSettings: this.options.rendererSettings || {}
        };

        this.viewWidth = this.width + 'px' || '100%';
        this.viewHeight = this.height + 'px' || '100%';

        let anim: any = lottie.loadAnimation(this._options);
        this.animCreated.emit(anim);
    }
}