mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +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
8e50ea4a18
commit
2e2d19b98c
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