Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Doikki committed Dec 5, 2018
2 parents baac64f + aa48205 commit c4d4d9c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ public void onPageRelease(boolean isNext, int position) {
@Override
public void onPageSelected(int position, boolean isBottom) {
if (mCurrentPosition == position) return;
ViewParent parent = mIjkVideoView.getParent();
if (parent != null && parent instanceof FrameLayout) {
((FrameLayout) parent).removeView(mIjkVideoView);
}
startPlay(position);
mCurrentPosition = position;
}
Expand All @@ -99,6 +95,10 @@ private void startPlay(int position) {
.load(mVideoList.get(position).getThumb())
.placeholder(android.R.color.white)
.into(mTikTokController.getThumb());
ViewParent parent = mIjkVideoView.getParent();
if (parent != null && parent instanceof FrameLayout) {
((FrameLayout) parent).removeView(mIjkVideoView);
}
frameLayout.addView(mIjkVideoView);
mIjkVideoView.setUrl(mVideoList.get(position).getUrl());
mIjkVideoView.setScreenScale(IjkVideoView.SCREEN_SCALE_CENTER_CROP);
Expand Down

0 comments on commit c4d4d9c

Please sign in to comment.