提交 ebe73dc5 编写于 作者: S shuyu

1.4.6 修改了出现除以0的的问题,全屏时候调整UI样式无效的情况

上级 8eb333b2
......@@ -43,7 +43,9 @@ public class DetailPlayer extends AppCompatActivity {
ButterKnife.bind(this);
String url = "http://baobab.wdjcdn.com/14564977406580.mp4";
detailPlayer.setUp(url, true, null, "测试视频");
//String url = "https://s3.cn-north-1.amazonaws.com.cn/talkpal/lecture/video/472/v.mp4";
//String url = "https://d131x7vzzf85jg.cloudfront.net/upload/documents/paper/b2/61/00/00/20160420_115018_b544.mp4";
detailPlayer.setUp(url, false, null, "测试视频");
//增加封面
ImageView imageView = new ImageView(this);
......@@ -102,6 +104,13 @@ public class DetailPlayer extends AppCompatActivity {
}
});
detailPlayer.setBottomProgressBarDrawable(getResources().getDrawable(R.drawable.video_new_progress));
detailPlayer.setDialogVolumeProgressBar(getResources().getDrawable(R.drawable.video_new_volume_progress_bg));
detailPlayer.setDialogProgressBar(getResources().getDrawable(R.drawable.video_new_progress));
detailPlayer.setBottomShowProgressBarDrawable(getResources().getDrawable(R.drawable.video_new_seekbar_progress),
getResources().getDrawable(R.drawable.video_new_seekbar_thumb));
detailPlayer.setDialogProgressColor(getResources().getColor(R.color.colorAccent), -11);
}
@Override
......
......@@ -109,7 +109,7 @@ public class CustomGSYVideoPlayer extends StandardGSYVideoPlayer {
//设置帧预览图的显示位置
mPreviewLayout.setLayoutParams(layoutParams);
if (GSYPreViewManager.instance().getMediaPlayer() != null
&& mHadPlay && (mCacheFile || mOpenPreView)
&& mHadPlay && (mOpenPreView)
&& GSYPreViewManager.instance().isSeekToComplete()) {
GSYPreViewManager.instance().setSeekToComplete(false);
int time = progress * getDuration() / 100;
......
......@@ -628,7 +628,8 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mDialogSeekTime.setText(seekTime);
mDialogTotalTime.setText(" / " + totalTime);
mDialogProgressBar.setProgress(seekTimePosition * 100 / totalTimeDuration);
if (totalTimeDuration > 0)
mDialogProgressBar.setProgress(seekTimePosition * 100 / totalTimeDuration);
if (deltaX > 0) {
mDialogIcon.setBackgroundResource(R.drawable.video_forward_icon);
} else {
......@@ -741,6 +742,7 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
StandardGSYVideoPlayer gsyVideoPlayer = (StandardGSYVideoPlayer) gsyBaseVideoPlayer;
gsyVideoPlayer.setStandardVideoAllCallBack(mStandardVideoAllCallBack);
gsyVideoPlayer.setNeedLockFull(isNeedLockFull());
initFullUI(gsyVideoPlayer);
}
return gsyBaseVideoPlayer;
}
......@@ -763,6 +765,33 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
setStateAndUi(CURRENT_STATE_NORMAL);
}
/**
* 全屏的UI逻辑
*/
private void initFullUI(StandardGSYVideoPlayer standardGSYVideoPlayer) {
if (mBottomProgressDrawable != null) {
standardGSYVideoPlayer.setBottomProgressBarDrawable(mBottomProgressDrawable);
}
if (mBottomShowProgressDrawable != null && mBottomShowProgressThumbDrawable != null) {
standardGSYVideoPlayer.setBottomShowProgressBarDrawable(mBottomShowProgressDrawable,
mBottomShowProgressThumbDrawable);
}
if (mVolumeProgressDrawable != null) {
standardGSYVideoPlayer.setDialogVolumeProgressBar(mVolumeProgressDrawable);
}
if (mDialogProgressBarDrawable != null) {
standardGSYVideoPlayer.setDialogProgressBar(mDialogProgressBarDrawable);
}
if (mDialogProgressHighLightColor >= 0 && mDialogProgressNormalColor >= 0) {
standardGSYVideoPlayer.setDialogProgressColor(mDialogProgressHighLightColor, mDialogProgressNormalColor);
}
}
private void startDismissControlViewTimer() {
cancelDismissControlViewTimer();
DISSMISS_CONTROL_VIEW_TIMER = new Timer();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册