mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
web: Fix animation loading bug
when `lottie-player` has no `src` at first rendering, programmatical load wasn't working
This commit is contained in:
parent
f89a40b9b9
commit
54930af3a3
1 changed files with 6 additions and 5 deletions
|
@ -306,12 +306,13 @@ export class LottiePlayer extends LitElement {
|
||||||
this._observer = new IntersectionObserver(_observerCallback);
|
this._observer = new IntersectionObserver(_observerCallback);
|
||||||
this._observer.observe(this);
|
this._observer.observe(this);
|
||||||
|
|
||||||
|
if (!this._TVG) {
|
||||||
|
this._timer = setInterval(this._delayedLoad.bind(this), 100);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.src) {
|
if (this.src) {
|
||||||
if (this._TVG) {
|
this.load(this.src, this.mimeType);
|
||||||
this.load(this.src, this.mimeType);
|
|
||||||
} else {
|
|
||||||
this._timer = setInterval(this._delayedLoad.bind(this), 100);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue