Skip to content

Commit

Permalink
修复列表到任务详情中bug和内存泄漏问题
Browse files Browse the repository at this point in the history
  • Loading branch information
CarGuoSmall committed Sep 13, 2018
1 parent b2e249a commit 6648391
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ private String getUrl() {
//断网自动重新链接,url前接上ijkhttphook:
//String url = "ijkhttphook:https://res.exexm.com/cw_145225549855002";

//
String url = "http://7xjmzj.com1.z0.glb.clouddn.com/20171026175005_JObCxCE2.mp4";
String url = "http://9890.vod.myqcloud.com/9890_4e292f9a3dd011e6b4078980237cc3d3.f20.mp4";
//String url = "http://7xjmzj.com1.z0.glb.clouddn.com/20171026175005_JObCxCE2.mp4";
//String url = "http://hjq-1257036536.cos.ap-shanghai.myqcloud.com/m3u8/m1/out2.m3u8";
//String url = "http://223.110.243.138/PLTV/2510088/224/3221227177/index.m3u8";
//String url = "http://qiniu.carmmi.com/image/132451525666042.mp4";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import com.example.gsyvideoplayer.R;
import com.example.gsyvideoplayer.model.VideoModel;
import com.shuyu.gsyvideoplayer.GSYVideoManager;
import com.shuyu.gsyvideoplayer.utils.OrientationUtils;
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;

Expand Down Expand Up @@ -88,7 +89,13 @@ public View getView(final int position, View convertView, ViewGroup parent) {
viewGroup.removeView(holder.imageView);
}
holder.gsyVideoPlayer.setThumbImageView(holder.imageView);
holder.gsyVideoPlayer.getThumbImageViewLayout().setVisibility(View.VISIBLE);

if (GSYVideoManager.instance().getPlayTag().equals(SwitchListVideoAdapter.TAG)
&& (position == GSYVideoManager.instance().getPlayPosition())) {
holder.gsyVideoPlayer.getThumbImageViewLayout().setVisibility(View.GONE);
} else {
holder.gsyVideoPlayer.getThumbImageViewLayout().setVisibility(View.VISIBLE);
}

return convertView;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ public void onClick(View v) {
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();

Debuger.printfLog(GSYVideoControlView.this.hashCode() + "------------------------------ dismiss onDetachedFromWindow");
cancelProgressTimer();
cancelDismissControlViewTimer();
}
Expand Down Expand Up @@ -305,7 +307,6 @@ public void onError(int what, int extra) {
@Override
protected void setStateAndUi(int state) {
mCurrentState = state;

if ((state == CURRENT_STATE_NORMAL && isCurrentMediaListener())
|| state == CURRENT_STATE_AUTO_COMPLETE || state == CURRENT_STATE_ERROR) {
mHadPrepared = false;
Expand All @@ -314,6 +315,7 @@ protected void setStateAndUi(int state) {
switch (mCurrentState) {
case CURRENT_STATE_NORMAL:
if (isCurrentMediaListener()) {
Debuger.printfLog(GSYVideoControlView.this.hashCode() + "------------------------------ dismiss CURRENT_STATE_NORMAL");
cancelProgressTimer();
getGSYVideoManager().releaseMediaPlayer();
releasePauseCover();
Expand All @@ -329,9 +331,13 @@ protected void setStateAndUi(int state) {
resetProgressAndTime();
break;
case CURRENT_STATE_PLAYING:
startProgressTimer();
if (isCurrentMediaListener()) {
Debuger.printfLog(GSYVideoControlView.this.hashCode() + "------------------------------ CURRENT_STATE_PLAYING");
startProgressTimer();
}
break;
case CURRENT_STATE_PAUSE:
Debuger.printfLog(GSYVideoControlView.this.hashCode() + "------------------------------ CURRENT_STATE_PAUSE");
startProgressTimer();
break;
case CURRENT_STATE_ERROR:
Expand All @@ -340,6 +346,7 @@ protected void setStateAndUi(int state) {
}
break;
case CURRENT_STATE_AUTO_COMPLETE:
Debuger.printfLog(GSYVideoControlView.this.hashCode() + "------------------------------ dismiss CURRENT_STATE_AUTO_COMPLETE");
cancelProgressTimer();
if (mProgressBar != null) {
mProgressBar.setProgress(100);
Expand Down Expand Up @@ -476,6 +483,9 @@ public boolean onTouch(View v, MotionEvent event) {

touchSurfaceUp();


Debuger.printfLog(GSYVideoControlView.this.hashCode() + "------------------------------ surface_container ACTION_UP");

startProgressTimer();

//不要和隐藏虚拟按键后,滑出虚拟按键冲突
Expand All @@ -499,6 +509,8 @@ public boolean onTouch(View v, MotionEvent event) {
break;
case MotionEvent.ACTION_UP:
startDismissControlViewTimer();

Debuger.printfLog(GSYVideoControlView.this.hashCode() + "------------------------------ progress ACTION_UP");
startProgressTimer();
ViewParent vpup = getParent();
while (vpup != null) {
Expand Down Expand Up @@ -591,6 +603,8 @@ public void onPrepared() {
super.onPrepared();
if (mCurrentState != CURRENT_STATE_PREPAREING) return;
startProgressTimer();

Debuger.printfLog(GSYVideoControlView.this.hashCode() + "------------------------------ surface_container onPrepared");
}


Expand Down

0 comments on commit 6648391

Please sign in to comment.