Skip to content

Commit

Permalink
测试封面
Browse files Browse the repository at this point in the history
  • Loading branch information
CarGuoSmall committed May 29, 2018
1 parent d36eb6b commit d8cf0d7
Showing 1 changed file with 17 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@
import android.content.Context;
import android.graphics.Point;
import android.util.AttributeSet;
import android.view.Surface;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.DecodeFormat;
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.resource.bitmap.VideoBitmapDecoder;
import com.bumptech.glide.request.RequestOptions;
import com.example.gsyvideoplayer.R;
import com.shuyu.gsyvideoplayer.utils.Debuger;
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;
import com.shuyu.gsyvideoplayer.video.base.GSYBaseVideoPlayer;

import moe.codeest.enviews.ENDownloadView;

/**
* 带封面
* Created by guoshuyu on 2017/9/3.
Expand Down Expand Up @@ -84,78 +80,34 @@ public GSYBaseVideoPlayer startWindowFullscreen(Context context, boolean actionB
@Override
public GSYBaseVideoPlayer showSmallVideo(Point size, boolean actionBar, boolean statusBar) {
//下面这里替换成你自己的强制转化
SampleCoverVideo sampleCoverVideo = (SampleCoverVideo) super.showSmallVideo(size, actionBar, statusBar);
SampleCoverVideo sampleCoverVideo = (SampleCoverVideo)super.showSmallVideo(size, actionBar, statusBar);
sampleCoverVideo.mStartButton.setVisibility(GONE);
sampleCoverVideo.mStartButton = null;
return sampleCoverVideo;
}


/**
* 下方两个重载方法,在播放开始不显示底部进度
*/
@Override
protected void changeUiToPreparingShow() {
super.changeUiToPreparingShow();
setViewShowState(mBottomContainer, INVISIBLE);
setViewShowState(mThumbImageViewLayout, VISIBLE);
}

@Override
protected void changeUiToPrepareingClear() {
super.changeUiToPrepareingClear();
setViewShowState(mThumbImageViewLayout, VISIBLE);
}

/**下方两个重载方法,在播放开始前不屏蔽封面*/
@Override
protected void changeUiToPlayingShow() {
Debuger.printfLog("changeUiToPlayingShow");

setViewShowState(mTopContainer, VISIBLE);
setViewShowState(mBottomContainer, VISIBLE);
setViewShowState(mStartButton, VISIBLE);
setViewShowState(mLoadingProgressBar, INVISIBLE);
public void onSurfaceUpdated(Surface surface) {
super.onSurfaceUpdated(surface);
if (mThumbImageViewLayout != null && mThumbImageViewLayout.getVisibility() == VISIBLE) {
postDelayed(new Runnable() {
@Override
public void run() {
setViewShowState(mThumbImageViewLayout, INVISIBLE);
}
}, 300);
mThumbImageViewLayout.setVisibility(INVISIBLE);
}
setViewShowState(mBottomProgressBar, INVISIBLE);
setViewShowState(mLockScreen, (mIfCurrentIsFullscreen && mNeedLockFull) ? VISIBLE : GONE);
}

if (mLoadingProgressBar instanceof ENDownloadView) {
((ENDownloadView) mLoadingProgressBar).reset();
@Override
protected void setViewShowState(View view, int visibility) {
if (view == mThumbImageViewLayout && visibility != VISIBLE) {
return;
}
updateStartImage();
super.setViewShowState(view, visibility);
}

/**下方两个重载方法,在播放开始不显示底部进度*/
@Override
protected void changeUiToPlayingBufferingShow() {

setViewShowState(mTopContainer, VISIBLE);
setViewShowState(mBottomContainer, VISIBLE);
setViewShowState(mStartButton, INVISIBLE);
setViewShowState(mLoadingProgressBar, VISIBLE);
if (mThumbImageViewLayout != null && mThumbImageViewLayout.getVisibility() == VISIBLE) {
postDelayed(new Runnable() {
@Override
public void run() {
setViewShowState(mThumbImageViewLayout, INVISIBLE);
}
}, 300);
}
setViewShowState(mBottomProgressBar, INVISIBLE);
setViewShowState(mLockScreen, GONE);

if (mLoadingProgressBar instanceof ENDownloadView) {
ENDownloadView enDownloadView = (ENDownloadView) mLoadingProgressBar;
if (enDownloadView.getCurrentState() == ENDownloadView.STATE_PRE) {
((ENDownloadView) mLoadingProgressBar).start();
}
}
protected void changeUiToPreparingShow() {
super.changeUiToPreparingShow();
setViewShowState(mBottomContainer, INVISIBLE);
}

@Override
Expand Down

0 comments on commit d8cf0d7

Please sign in to comment.