diff --git a/SDWebImage/Core/SDAnimatedImageView.m b/SDWebImage/Core/SDAnimatedImageView.m index f0b811c4..e9734383 100644 --- a/SDWebImage/Core/SDAnimatedImageView.m +++ b/SDWebImage/Core/SDAnimatedImageView.m @@ -19,6 +19,7 @@ @interface SDAnimatedImageView () { BOOL _initFinished; // Extra flag to mark the `commonInit` is called NSRunLoopMode _runLoopMode; + NSUInteger _maxBufferSize; double _playbackRate; } @@ -153,6 +154,9 @@ // RunLoop Mode self.player.runLoopMode = self.runLoopMode; + // Max Buffer Size + self.player.maxBufferSize = self.maxBufferSize; + // Play Rate self.player.playbackRate = self.playbackRate; @@ -207,6 +211,16 @@ return [NSProcessInfo processInfo].activeProcessorCount > 1 ? NSRunLoopCommonModes : NSDefaultRunLoopMode; } +- (void)setMaxBufferSize:(NSUInteger)maxBufferSize +{ + _maxBufferSize = maxBufferSize; + self.player.maxBufferSize = maxBufferSize; +} + +- (NSUInteger)maxBufferSize { + return _maxBufferSize; // Defaults to 0 +} + - (void)setPlaybackRate:(double)playbackRate { _playbackRate = playbackRate;