提交 d8cf0d79 编写于 作者: G guoshuyu

测试封面

上级 d36eb6bc
......@@ -3,20 +3,16 @@ package com.example.gsyvideoplayer.video;
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.
......@@ -84,78 +80,34 @@ public class SampleCoverVideo extends StandardGSYVideoPlayer {
@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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册