Skip to content

Commit

Permalink
fixed:#176
Browse files Browse the repository at this point in the history
  • Loading branch information
dito010 committed Jun 30, 2018
1 parent 9808e7d commit cc97464
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion JPVideoPlayer/JPVideoPlayerSupportUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ - (void)handleScrollStopIfNeed {
}

// If the found cell is the cell playing video, this situation cannot play video again.
if(bestCell == self.playingVideoCell){
if([bestCell jp_isEqualToCell:self.playingVideoCell]){
return;
}

Expand Down
10 changes: 10 additions & 0 deletions JPVideoPlayer/UITableViewCell+WebVideoCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property(nonatomic) JPVideoPlayerUnreachableCellType jp_unreachableCellType;

/**
* Returns a Boolean value that indicates whether a given cell is equal to
* the receiver using `jp_videoURL` comparison.
*
* @param cell The cell with which to compare the receiver.
*
* @return YES if cell is equivalent to the receiver (if they have the same `jp_videoURL` comparison), otherwise NO.
*/
- (BOOL)jp_isEqualToCell:(UITableViewCell *)cell;

@end

NS_ASSUME_NONNULL_END
7 changes: 7 additions & 0 deletions JPVideoPlayer/UITableViewCell+WebVideoCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,11 @@ - (JPVideoPlayerUnreachableCellType)jp_unreachableCellType {
return [objc_getAssociatedObject(self, _cmd) integerValue];
}

- (BOOL)jp_isEqualToCell:(UITableViewCell *)cell {
if(!self.jp_videoURL && !cell.jp_videoURL){
return self == cell;
}
return [self.jp_videoURL.absoluteString isEqualToString:cell.jp_videoURL.absoluteString];
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ - (void)viewDidLoad {
[super viewDidLoad];

self.title = @"音频播放";
[self.audioView jp_playVideoWithURL:[NSURL URLWithString:@"http://p11s9kqxf.bkt.clouddn.com/remember%20me.mp3"]
[self.audioView jp_playVideoWithURL:[NSURL URLWithString:@"http://music.163.com/song/media/outer/url?id=518066666.mp3"]
bufferingIndicator:nil
controlView:nil progressView:nil
configurationCompletion:nil];
Expand Down

0 comments on commit cc97464

Please sign in to comment.