This commit is contained in:
Insomnia 2020-10-28 18:13:00 +08:00
parent 184c8768fa
commit aa89511c74
2 changed files with 13 additions and 4 deletions

View File

@ -140,9 +140,7 @@
#pragma mark - State Control
- (void)setupCurrentFrame {
if (self.playbackMode == SDAnimatedImagePlaybackModeReversedBounce) {
self.currentFrameIndex = self.totalFrameCount - 1;
}
if (self.playbackMode == )
if ([self.animatedProvider isKindOfClass:[UIImage class]]) {
UIImage *image = (UIImage *)self.animatedProvider;
@ -183,7 +181,7 @@
- (void)startPlaying {
[self.displayLink start];
// Setup frame
[self setupCurrentFrame];
[self setupCurrentFrame];
// Calculate max buffer size
[self calculateMaxBufferCount];
}

View File

@ -23,6 +23,7 @@
NSRunLoopMode _runLoopMode;
NSUInteger _maxBufferSize;
double _playbackRate;
SDAnimatedImagePlaybackMode _playbackMode;
}
@property (nonatomic, strong, readwrite) UIImage *currentFrame;
@ -241,6 +242,16 @@
return _playbackRate;
}
- (void)setPlaybackMode:(SDAnimatedImagePlaybackMode)playbackMode {
_playbackMode = playbackMode;
self.player.playbackMode = playbackMode;
}
- (SDAnimatedImagePlaybackMode)playbackMode {
return _playbackMode;
}
- (BOOL)shouldIncrementalLoad
{
if (!_initFinished) {