Merge pull request #2934 from dreampiggy/bugfix_max_buffer_size
Fix the issue that `maxBufferSize` property does not correctlly works for `SDAnimatedImageView`
This commit is contained in:
commit
3459cd2fd0
|
@ -19,6 +19,7 @@
|
|||
@interface SDAnimatedImageView () <CALayerDelegate> {
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue