Skip to content

Commit

Permalink
修复了可移动小窗口播放结束无法移动的问题 (2017-04-20)
Browse files Browse the repository at this point in the history
  • Loading branch information
CarGuo committed Apr 20, 2017
1 parent 5bac38c commit 4a46ead
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -488,10 +488,14 @@ protected void addTextureView() {
**/
@Override
protected void setSmallVideoTextureView(View.OnTouchListener onTouchListener) {
mTextureView.setOnTouchListener(onTouchListener);
mTextureViewContainer.setOnTouchListener(onTouchListener);
mProgressBar.setOnTouchListener(null);
mFullscreenButton.setOnTouchListener(null);
mTextureView.setOnClickListener(null);
mFullscreenButton.setVisibility(INVISIBLE);
mProgressBar.setVisibility(INVISIBLE);
mCurrentTimeTextView.setVisibility(INVISIBLE);
mTotalTimeTextView.setVisibility(INVISIBLE);
mTextureViewContainer.setOnClickListener(null);
mSmallClose.setVisibility(VISIBLE);
mSmallClose.setOnClickListener(new OnClickListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ public abstract class GSYBaseVideoPlayer extends FrameLayout implements GSYMedia

protected boolean mCacheFile = false; //是否是缓存的文件

protected boolean mIsTouchWiget = true; //是否支持非全屏滑动触摸有效

protected boolean mIsTouchWigetFull = true; //是否支持全屏滑动触摸有效

protected Context mContext;

protected String mOriginUrl; //原来的url
Expand Down Expand Up @@ -133,10 +137,6 @@ public abstract class GSYBaseVideoPlayer extends FrameLayout implements GSYMedia

protected OrientationUtils mOrientationUtils; //旋转工具类

protected boolean mIsTouchWiget = true; //是否支持非全屏滑动触摸有效

protected boolean mIsTouchWigetFull = true; //是否支持全屏滑动触摸有效

private Handler mHandler = new Handler();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ private void updatePauseCover() {
}

@Override
@SuppressWarnings("ResourceType")
protected void showProgressDialog(float deltaX, String seekTime, int seekTimePosition, String totalTime, int totalTimeDuration) {
super.showProgressDialog(deltaX, seekTime, seekTimePosition, totalTime, totalTimeDuration);
if (mProgressDialog == null) {
Expand Down Expand Up @@ -821,11 +822,19 @@ public GSYBaseVideoPlayer showSmallVideo(Point size, boolean actionBar, boolean
GSYBaseVideoPlayer gsyBaseVideoPlayer = super.showSmallVideo(size, actionBar, statusBar);
if (gsyBaseVideoPlayer != null) {
StandardGSYVideoPlayer gsyVideoPlayer = (StandardGSYVideoPlayer) gsyBaseVideoPlayer;
gsyVideoPlayer.setIsTouchWiget(false);//小窗口不能点击
gsyVideoPlayer.setStandardVideoAllCallBack(mStandardVideoAllCallBack);
}
return gsyBaseVideoPlayer;
}

@Override
protected void setSmallVideoTextureView(View.OnTouchListener onTouchListener) {
super.setSmallVideoTextureView(onTouchListener);
//小窗口播放停止了也可以移动
mThumbImageViewLayout.setOnTouchListener(onTouchListener);
}

/**
* 处理锁屏屏幕触摸逻辑
*/
Expand Down

0 comments on commit 4a46ead

Please sign in to comment.