The progressive animation should not update the loop count to 1 when automatically stopped at last index.

This commit is contained in:
DreamPiggy 2020-01-18 15:38:02 +08:00
parent 03c1d655b6
commit 5510650c04
1 changed files with 2 additions and 1 deletions

View File

@ -166,12 +166,13 @@
}; };
self.player.animationLoopHandler = ^(NSUInteger loopCount) { self.player.animationLoopHandler = ^(NSUInteger loopCount) {
@strongify(self); @strongify(self);
self.currentLoopCount = loopCount;
// Progressive image reach the current last frame index. Keep the state and pause animating. Wait for later restart // Progressive image reach the current last frame index. Keep the state and pause animating. Wait for later restart
if (self.isProgressive) { if (self.isProgressive) {
NSUInteger lastFrameIndex = self.player.totalFrameCount - 1; NSUInteger lastFrameIndex = self.player.totalFrameCount - 1;
[self.player seekToFrameAtIndex:lastFrameIndex loopCount:0]; [self.player seekToFrameAtIndex:lastFrameIndex loopCount:0];
[self.player pausePlaying]; [self.player pausePlaying];
} else {
self.currentLoopCount = loopCount;
} }
}; };