Skip to content

Tags: kaishin/Gifu

Tags

v3.4.1

Toggle v3.4.1's commit message

v3.4

Toggle v3.4's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Add `loopBlock` callback for when a loop is finished (#183)

It's called every time the last frame is shown, on every loop. This is
different to `animationBlock` which is only called after all the loops
have finished (and never for infinite loops).

Why? I have a use case where I'm playing a GIF in an infinite loop but I
want to know when it has been shown at least once (first loop has been
completed).

Currently, there's no good way to satisfy this use case. One way is to
read `loopDuration` and then schedule a timer to fire when that time has
elapsed, which is roughly when one loop has happened. But in addition to
being inaccurate, it's very fiddly because the timer has to be
paused/unpaused if the GIF is paused/unpaused.

Another way you might think would work is to use `loopCount: 1` instead
and then use `animationBlock`. Then there just start playback again for
the rest of the loops. The problem with that is that there's no way to
restart without preparing the frames again AFAICT.

With this new callback, it's very straightforward.

v3.3.1

Toggle v3.3.1's commit message

v3.3

Toggle v3.3's commit message

v3.3.0

Toggle v3.3.0's commit message

v3.2.2

Toggle v3.2.2's commit message
Bump version to 3.2.2

v3.2.1

Toggle v3.2.1's commit message
Bump to 3.2.1

v3.2.0

Toggle v3.2.0's commit message
Bump version to 3.2.0

v3.1.0

Toggle v3.1.0's commit message
Bump to v3.1.0

v3.0.0

Toggle v3.0.0's commit message
Bump to v3.0.0