Do not cause the display link to fire before user calling `startPlaying` method

This commit is contained in:
DreamPiggy 2019-11-08 22:23:50 +08:00
parent 48909c2a74
commit b75c227433
1 changed files with 2 additions and 1 deletions

View File

@ -108,6 +108,7 @@
if (!_displayLink) {
_displayLink = [SDDisplayLink displayLinkWithTarget:self selector:@selector(displayDidRefresh:)];
[_displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:self.runLoopMode];
[_displayLink stop];
}
return _displayLink;
}
@ -197,7 +198,7 @@
}
- (BOOL)isPlaying {
return self.displayLink.isRunning;
return _displayLink.isRunning;
}
- (void)seekToFrameAtIndex:(NSUInteger)index loopCount:(NSUInteger)loopCount {