Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Commit

Permalink
fix scroll when pause state bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lipan committed Nov 4, 2017
1 parent e924df7 commit 1ff6dba
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions jiaozivideoplayer/src/main/java/cn/jzvd/JZVideoPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1027,8 +1027,12 @@ public static void onScrollAutoTiny(AbsListView view, int firstVisibleItem, int
if ((currentPlayPosition < firstVisibleItem || currentPlayPosition > (lastVisibleItem - 1))) {
if (JZVideoPlayerManager.getCurrentJzvd() != null &&
JZVideoPlayerManager.getCurrentJzvd().currentScreen != JZVideoPlayer.SCREEN_WINDOW_TINY) {
Log.e(TAG, "onScroll: out screen");
JZVideoPlayerManager.getCurrentJzvd().startWindowTiny();
if (JZVideoPlayerManager.getCurrentJzvd().currentState == JZVideoPlayer.CURRENT_STATE_PAUSE) {
JZVideoPlayer.releaseAllVideos();
} else {
Log.e(TAG, "onScroll: out screen");
JZVideoPlayerManager.getCurrentJzvd().startWindowTiny();
}
}
} else {
if (JZVideoPlayerManager.getCurrentJzvd() != null &&
Expand Down Expand Up @@ -1063,7 +1067,11 @@ public static void onChildViewDetachedFromWindow(View view) {
if (JZVideoPlayerManager.getCurrentJzvd() != null && JZVideoPlayerManager.getCurrentJzvd().currentScreen != JZVideoPlayer.SCREEN_WINDOW_TINY) {
JZVideoPlayer videoPlayer = JZVideoPlayerManager.getCurrentJzvd();
if (((ViewGroup) view).indexOfChild(videoPlayer) != -1) {
videoPlayer.startWindowTiny();
if (videoPlayer.currentState == JZVideoPlayer.CURRENT_STATE_PAUSE) {
JZVideoPlayer.releaseAllVideos();
} else {
videoPlayer.startWindowTiny();
}
}
}
}
Expand Down

0 comments on commit 1ff6dba

Please sign in to comment.