diff --git a/src/components/common/AnimatedSticker.tsx b/src/components/common/AnimatedSticker.tsx index d9b23ba3e..0efe30417 100644 --- a/src/components/common/AnimatedSticker.tsx +++ b/src/components/common/AnimatedSticker.tsx @@ -190,7 +190,7 @@ const AnimatedSticker: FC = ({ } if (playSegmentRef.current) { - animation.playSegment(playSegmentRef.current); + animation.playSegment(playSegmentRef.current, viewId); } else { animation.play(shouldRestart, viewId); } diff --git a/src/lib/rlottie/RLottie.ts b/src/lib/rlottie/RLottie.ts index 1eb2b3e0c..0facc02b5 100644 --- a/src/lib/rlottie/RLottie.ts +++ b/src/lib/rlottie/RLottie.ts @@ -116,7 +116,7 @@ class RLottie { private tgsUrl: string, private container: HTMLDivElement | HTMLCanvasElement, private renderId: string, - private viewId: string = generateIdFor(ID_STORE, true), + viewId: string = generateIdFor(ID_STORE, true), private params: Params = {}, private customColor?: [number, number, number], private onLoad?: NoneToVoidFunction | undefined, @@ -197,10 +197,14 @@ class RLottie { } } - playSegment([startFrameIndex, stopFrameIndex]: [number, number]) { + playSegment([startFrameIndex, stopFrameIndex]: [number, number], viewId?: string) { + if (viewId) { + this.views.get(viewId)!.isPaused = false; + } this.approxFrameIndex = Math.floor(startFrameIndex / this.reduceFactor); this.stopFrameIndex = Math.floor(stopFrameIndex / this.reduceFactor); this.direction = startFrameIndex < stopFrameIndex ? 1 : -1; + this.doPlay(); }