Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
loop: true,
autoplay: this._playing,
assetsPath: `${this._assetsPath}/${this._hash}/`,
// Apparently the lottie player modifies the data as it runs?
animationData: JSON.parse(JSON.stringify(this._state.lottie)),
rendererSettings: {
preserveAspectRatio:'xMidYMid meet'
},
});
this._live = null;
} else {
// we have edits, update the live preview version.
// It will re-start from the very beginning, but the user can
// hit "rewind" to re-sync them.
$$('#live').innerHTML = '';
this._live = bodymovin.loadAnimation({
container: $$('#live'),
renderer: 'svg',
loop: true,
autoplay: this._playing,
assetsPath: `${this._assetsPath}/${this._hash}/`,
// Apparently the lottie player modifies the data as it runs?
animationData: JSON.parse(JSON.stringify(this._editor.get())),
rendererSettings: {
preserveAspectRatio:'xMidYMid meet'
},
});
}
}
_renderLottieWeb() {
if (!this._showLottie) {
return;
}
// Don't re-start the animation while the user edits.
if (!this._hasEdits) {
$$('#container').innerHTML = '';
this._lottie = bodymovin.loadAnimation({
container: $$('#container'),
renderer: 'svg',
loop: true,
autoplay: this._playing,
assetsPath: `${this._assetsPath}/${this._hash}/`,
// Apparently the lottie player modifies the data as it runs?
animationData: JSON.parse(JSON.stringify(this._state.lottie)),
rendererSettings: {
preserveAspectRatio:'xMidYMid meet'
},
});
this._live = null;
} else {
// we have edits, update the live preview version.
// It will re-start from the very beginning, but the user can
// hit "rewind" to re-sync them.