lazy-line-painter icon indicating copy to clipboard operation
lazy-line-painter copied to clipboard

Refocussing Chrome tab resumes playback

Open mulhoon opened this issue 5 years ago • 1 comments

Hi! Great library!

I have an issue - I control an animation with .set() and then change tab, when I click back on the tab, the animation automatically plays. How can I stop it playing automatically?

I think it' related to this. https://github.com/camoconnell/lazy-line-painter/blob/4908749499a03586cd9e026ad6b4e0b9231ede38/src/index.js#L67

Thanks

mulhoon avatar Apr 23 '19 10:04 mulhoon

+1

I solved this by cloning svg element and calling destory on complete callback _onVisibilityChange probably should resume only if animation is playing

davidarny avatar May 09 '19 12:05 davidarny