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