Skip to content

Commit

Permalink
Merge pull request #56 from LottieFiles/fix/segment-on-visible
Browse files Browse the repository at this point in the history
fix(scrolling): fixed segments not playing on scroll with 'play' action type
  • Loading branch information
samuelOsborne authored Feb 1, 2022
2 parents b218b60 + 9d360c7 commit eff63f5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,11 @@ export class LottieInteractivity {
if (!this.scrolledAndPlayed) {
this.scrolledAndPlayed = true;
this.player.resetSegments(true);
this.player.play();
if (action.frames) {
this.player.playSegments(action.frames, true);
} else {
this.player.play();
}
}
} else if (action.type === 'stop') {
// Stop: Stop playback
Expand Down

0 comments on commit eff63f5

Please sign in to comment.