|
|
|
@ -54,7 +54,9 @@ export class RLottiePlayer extends EventListenerBase<{
@@ -54,7 +54,9 @@ export class RLottiePlayer extends EventListenerBase<{
|
|
|
|
|
public direction = 1; |
|
|
|
|
public speed = 1; |
|
|
|
|
public autoplay = true; |
|
|
|
|
public _autoplay: boolean; // ! will be used to store original value for settings.stickers.loop
|
|
|
|
|
public loop = true; |
|
|
|
|
public _loop: boolean; // ! will be used to store original value for settings.stickers.loop
|
|
|
|
|
public group = ''; |
|
|
|
|
|
|
|
|
|
private frInterval: number; |
|
|
|
@ -92,6 +94,9 @@ export class RLottiePlayer extends EventListenerBase<{
@@ -92,6 +94,9 @@ export class RLottiePlayer extends EventListenerBase<{
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this._loop = this.loop; |
|
|
|
|
this._autoplay = this.autoplay; |
|
|
|
|
|
|
|
|
|
// * Skip ratio (30fps)
|
|
|
|
|
let skipRatio: number; |
|
|
|
|
if(options.skipRatio !== undefined) skipRatio = options.skipRatio; |
|
|
|
@ -539,8 +544,8 @@ class LottieLoader {
@@ -539,8 +544,8 @@ class LottieLoader {
|
|
|
|
|
private log = logger('LOTTIE', LogLevels.error); |
|
|
|
|
|
|
|
|
|
public getAnimation(element: HTMLElement) { |
|
|
|
|
for(let i in this.players) { |
|
|
|
|
if(this.players[i].el == element) { |
|
|
|
|
for(const i in this.players) { |
|
|
|
|
if(this.players[i].el === element) { |
|
|
|
|
return this.players[i]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -548,6 +553,14 @@ class LottieLoader {
@@ -548,6 +553,14 @@ class LottieLoader {
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public setLoop(loop: boolean) { |
|
|
|
|
for(const i in this.players) { |
|
|
|
|
const player = this.players[i]; |
|
|
|
|
player.loop = loop; |
|
|
|
|
player.autoplay = player._autoplay; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public loadLottieWorkers() { |
|
|
|
|
if(typeof(WebAssembly) === 'undefined') return Promise.reject(); |
|
|
|
|
|
|
|
|
|