Skip to content

Commit

Permalink
修复兼容基类的canSeekToTime 出现的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
changsanjiang committed Mar 13, 2019
1 parent 579f63e commit 067e90a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions SJVideoPlayer/SJEdgeControlLayer/SJEdgeControlLayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@ - (void)_addItemsToBottomAdapter {
slider.tappedExeBlock = ^(SJProgressSlider * _Nonnull slider, CGFloat location) {
__strong typeof(_self) self = _self;
if ( !self ) return;
if ( self.videoPlayer.canSeekToTime ) {
if ( !self.videoPlayer.canSeekToTime(self.videoPlayer) )
return;
}

[self.videoPlayer seekToTime:location completionHandler:^(BOOL finished) {
__strong typeof(_self) self = _self;
if ( !self ) return;
Expand Down
2 changes: 2 additions & 0 deletions SJVideoPlayer/SJProgressSlider/SJProgressSlider.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ - (void)handlePanGR:(UIPanGestureRecognizer *)pan {
}
}
case UIGestureRecognizerStateChanged: {
if ( _isCancelled )
return;
if ( [self.delegate respondsToSelector:@selector(sliderDidDrag:)] ) {
[self.delegate sliderDidDrag:self];
}
Expand Down

0 comments on commit 067e90a

Please sign in to comment.