Skip to content

Commit

Permalink
Fix #419
Browse files Browse the repository at this point in the history
  • Loading branch information
changsanjiang committed Mar 12, 2021
1 parent dae8d1a commit 322fec7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Binary file not shown.
10 changes: 5 additions & 5 deletions Example/SJVideoPlayer/Demos/DY/SJDYMainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,12 @@ - (BOOL)canPerformPlayForListViewController:(SJDYPlaybackListViewController *)vc

- (void)pageMenuBar:(SJPageMenuBar *)bar focusedIndexDidChange:(NSUInteger)index {
if ( ![_pageViewController isViewControllerVisibleAtIndex:index] ) {
if ( _pageViewController.focusedIndex != NSNotFound ) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self playOrPause];
});
}
[_pageViewController setViewControllerAtIndex:index];
SJDYPlaybackListViewController *cur = [_pageViewController viewControllerAtIndex:index];
for ( SJDYPlaybackListViewController *vc in _pageViewController.cachedViewControllers ) {
if ( cur != vc ) [vc pause];
}
[cur playIfNeeded];
}
}

Expand Down

0 comments on commit 322fec7

Please sign in to comment.