Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ac13
GSYVideoPlayer
提交
c95acefe
G
GSYVideoPlayer
项目概览
ac13
/
GSYVideoPlayer
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
GSYVideoPlayer
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c95acefe
编写于
12月 05, 2016
作者:
S
shuyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.4.1 增加了锁定屏幕
上级
3fc382d7
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
95 addition
and
8 deletion
+95
-8
app/src/main/java/com/example/gsyvideoplayer/ListVideo2Activity.java
...n/java/com/example/gsyvideoplayer/ListVideo2Activity.java
+1
-0
app/src/main/java/com/example/gsyvideoplayer/adapter/ListNormalAdapter.java
...com/example/gsyvideoplayer/adapter/ListNormalAdapter.java
+2
-0
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/utils/ListVideoUtil.java
...in/java/com/shuyu/gsyvideoplayer/utils/ListVideoUtil.java
+14
-0
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/StandardGSYVideoPlayer.java
...om/shuyu/gsyvideoplayer/video/StandardGSYVideoPlayer.java
+68
-8
gsyVideoPlayer/src/main/res/drawable-xxhdpi/lock.png
gsyVideoPlayer/src/main/res/drawable-xxhdpi/lock.png
+0
-0
gsyVideoPlayer/src/main/res/drawable-xxhdpi/unlock.png
gsyVideoPlayer/src/main/res/drawable-xxhdpi/unlock.png
+0
-0
gsyVideoPlayer/src/main/res/layout/video_layout_standard.xml
gsyVideoPlayer/src/main/res/layout/video_layout_standard.xml
+10
-0
未找到文件。
app/src/main/java/com/example/gsyvideoplayer/ListVideo2Activity.java
浏览文件 @
c95acefe
...
...
@@ -51,6 +51,7 @@ public class ListVideo2Activity extends AppCompatActivity {
listVideoUtil
.
setFullViewContainer
(
videoFullContainer
);
listVideoUtil
.
setHideStatusBar
(
true
);
//listVideoUtil.setHideActionBar(true);
listVideoUtil
.
setNeedLockFull
(
true
);
listVideoAdapter
=
new
ListVideoAdapter
(
this
,
listVideoUtil
);
listVideoAdapter
.
setRootView
(
activityListVideo
);
...
...
app/src/main/java/com/example/gsyvideoplayer/adapter/ListNormalAdapter.java
浏览文件 @
c95acefe
...
...
@@ -145,6 +145,8 @@ public class ListNormalAdapter extends BaseAdapter {
holder
.
gsyVideoPlayer
.
setShowFullAnimation
(
true
);
//循环
//holder.gsyVideoPlayer.setLooping(true);
holder
.
gsyVideoPlayer
.
setNeedLockFull
(
true
);
holder
.
gsyVideoPlayer
.
setPlayPosition
(
position
);
holder
.
gsyVideoPlayer
.
setStandardVideoAllCallBack
(
sampleListener
);
...
...
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/utils/ListVideoUtil.java
浏览文件 @
c95acefe
...
...
@@ -57,6 +57,7 @@ public class ListVideoUtil {
private
boolean
hideActionBar
;
//是否隐藏有状态ActionBar
private
boolean
isLoop
;
//循环
private
boolean
hideKey
=
true
;
//隐藏按键
private
boolean
needLockFull
=
true
;
//隐藏按键
private
int
[]
listItemRect
;
//当前item框的屏幕位置
...
...
@@ -132,6 +133,8 @@ public class ListVideoUtil {
gsyVideoPlayer
.
setSpeed
(
speed
);
gsyVideoPlayer
.
setNeedLockFull
(
needLockFull
);
gsyVideoPlayer
.
setUp
(
url
,
true
,
cachePath
,
mapHeadData
,
objects
);
//增加title
...
...
@@ -604,4 +607,15 @@ public class ListVideoUtil {
this
.
hideKey
=
hideKey
;
}
public
boolean
isNeedLockFull
()
{
return
needLockFull
;
}
/**
* 是否需要全屏锁定屏幕功能
*/
public
void
setNeedLockFull
(
boolean
needLoadFull
)
{
this
.
needLockFull
=
needLoadFull
;
}
}
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/StandardGSYVideoPlayer.java
浏览文件 @
c95acefe
...
...
@@ -23,7 +23,6 @@ import android.widget.TextView;
import
android.widget.Toast
;
import
com.shuyu.gsyvideoplayer.GSYVideoManager
;
import
com.shuyu.gsyvideoplayer.GSYVideoPlayer
;
import
com.shuyu.gsyvideoplayer.R
;
import
com.shuyu.gsyvideoplayer.listener.StandardVideoAllCallBack
;
...
...
@@ -32,7 +31,6 @@ import com.shuyu.gsyvideoplayer.utils.Debuger;
import
com.shuyu.gsyvideoplayer.utils.NetworkUtils
;
import
java.io.File
;
import
java.util.Map
;
import
java.util.Timer
;
import
java.util.TimerTask
;
...
...
@@ -47,7 +45,7 @@ import moe.codeest.enviews.ENPlayView;
public
class
StandardGSYVideoPlayer
extends
GSYVideoPlayer
{
protected
static
Timer
DISSMISS_CONTROL_VIEW_TIMER
;
protected
Timer
DISSMISS_CONTROL_VIEW_TIMER
;
protected
ProgressBar
mBottomProgressBar
;
...
...
@@ -76,6 +74,7 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
protected
TextView
mDialogSeekTime
;
protected
TextView
mDialogTotalTime
;
protected
ImageView
mDialogIcon
;
protected
ImageView
mLockScreen
;
protected
Drawable
mBottomProgressDrawable
;
protected
Drawable
mBottomShowProgressDrawable
;
...
...
@@ -83,11 +82,16 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
protected
Drawable
mVolumeProgressDrawable
;
protected
Drawable
mDialogProgressBarDrawable
;
protected
boolean
mLockCurScreen
;
//锁定屏幕点击
protected
boolean
mNeedLockFull
;
//是否需要锁定屏幕
private
boolean
mThumbPlay
;
//是否点击封面播放
private
int
mDialogProgressHighLightColor
=
-
11
;
private
int
mDialogProgressNormalColor
=
-
11
;
private
boolean
mThumbPlay
;
//是否点击封面播放
public
void
setStandardVideoAllCallBack
(
StandardVideoAllCallBack
standardVideoAllCallBack
)
{
this
.
mStandardVideoAllCallBack
=
standardVideoAllCallBack
;
...
...
@@ -108,6 +112,7 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mBottomProgressBar
=
(
ProgressBar
)
findViewById
(
R
.
id
.
bottom_progressbar
);
mTitleTextView
=
(
TextView
)
findViewById
(
R
.
id
.
title
);
mThumbImageViewLayout
=
(
RelativeLayout
)
findViewById
(
R
.
id
.
thumb
);
mLockScreen
=
(
ImageView
)
findViewById
(
R
.
id
.
lock_screen
);
mLoadingProgressBar
=
(
ENDownloadView
)
findViewById
(
R
.
id
.
loading
);
...
...
@@ -132,6 +137,22 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mProgressBar
.
setThumb
(
mBottomShowProgressThumbDrawable
);
}
mLockScreen
.
setVisibility
(
GONE
);
mLockScreen
.
setOnClickListener
(
new
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
if
(
mLockCurScreen
)
{
mLockScreen
.
setImageResource
(
R
.
drawable
.
unlock
);
mLockCurScreen
=
false
;
}
else
{
mLockScreen
.
setImageResource
(
R
.
drawable
.
lock
);
mLockCurScreen
=
true
;
hideAllWidget
();
}
}
});
}
@Override
...
...
@@ -225,6 +246,11 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
break
;
}
}
if
(
mIfCurrentIsFullscreen
&&
mLockCurScreen
&&
mNeedLockFull
)
{
return
true
;
}
return
super
.
onTouch
(
v
,
event
);
}
...
...
@@ -302,6 +328,10 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
@Override
protected
void
onClickUiToggle
()
{
if
(
mIfCurrentIsFullscreen
&&
mLockCurScreen
&&
mNeedLockFull
)
{
mLockScreen
.
setVisibility
(
VISIBLE
);
return
;
}
if
(
mCurrentState
==
CURRENT_STATE_PREPAREING
)
{
if
(
mBottomContainer
.
getVisibility
()
==
View
.
VISIBLE
)
{
changeUiToPrepareingClear
();
...
...
@@ -360,6 +390,7 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mThumbImageViewLayout
.
setVisibility
(
View
.
VISIBLE
);
mCoverImageView
.
setVisibility
(
View
.
VISIBLE
);
mBottomProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
mLockScreen
.
setVisibility
((
mIfCurrentIsFullscreen
&&
mNeedLockFull
)
?
VISIBLE
:
GONE
);
updateStartImage
();
}
...
...
@@ -373,6 +404,7 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mThumbImageViewLayout
.
setVisibility
(
View
.
INVISIBLE
);
mCoverImageView
.
setVisibility
(
View
.
VISIBLE
);
mBottomProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
mLockScreen
.
setVisibility
(
GONE
);
}
private
void
changeUiToPrepareingClear
()
{
...
...
@@ -383,6 +415,7 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mThumbImageViewLayout
.
setVisibility
(
View
.
INVISIBLE
);
mBottomProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
mCoverImageView
.
setVisibility
(
View
.
VISIBLE
);
mLockScreen
.
setVisibility
(
GONE
);
}
private
void
changeUiToPlayingShow
()
{
...
...
@@ -395,6 +428,7 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mThumbImageViewLayout
.
setVisibility
(
View
.
INVISIBLE
);
mCoverImageView
.
setVisibility
(
View
.
INVISIBLE
);
mBottomProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
mLockScreen
.
setVisibility
((
mIfCurrentIsFullscreen
&&
mNeedLockFull
)
?
VISIBLE
:
GONE
);
updateStartImage
();
}
...
...
@@ -414,6 +448,7 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mThumbImageViewLayout
.
setVisibility
(
View
.
INVISIBLE
);
//mCoverImageView.setVisibility(View.INVISIBLE);
mBottomProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
mLockScreen
.
setVisibility
((
mIfCurrentIsFullscreen
&&
mNeedLockFull
)
?
VISIBLE
:
GONE
);
updateStartImage
();
updatePauseCover
();
}
...
...
@@ -435,6 +470,7 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mThumbImageViewLayout
.
setVisibility
(
View
.
INVISIBLE
);
mCoverImageView
.
setVisibility
(
View
.
INVISIBLE
);
mBottomProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
mLockScreen
.
setVisibility
(
GONE
);
}
private
void
changeUiToPlayingBufferingClear
()
{
...
...
@@ -447,6 +483,7 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mThumbImageViewLayout
.
setVisibility
(
View
.
INVISIBLE
);
mCoverImageView
.
setVisibility
(
View
.
INVISIBLE
);
mBottomProgressBar
.
setVisibility
(
View
.
VISIBLE
);
mLockScreen
.
setVisibility
(
GONE
);
updateStartImage
();
}
...
...
@@ -460,6 +497,7 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mThumbImageViewLayout
.
setVisibility
(
View
.
INVISIBLE
);
mCoverImageView
.
setVisibility
(
View
.
INVISIBLE
);
mBottomProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
mLockScreen
.
setVisibility
(
GONE
);
}
private
void
changeUiToCompleteShow
()
{
...
...
@@ -472,6 +510,7 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mThumbImageViewLayout
.
setVisibility
(
View
.
VISIBLE
);
mCoverImageView
.
setVisibility
(
View
.
INVISIBLE
);
mBottomProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
mLockScreen
.
setVisibility
((
mIfCurrentIsFullscreen
&&
mNeedLockFull
)
?
VISIBLE
:
GONE
);
updateStartImage
();
}
...
...
@@ -485,6 +524,7 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mThumbImageViewLayout
.
setVisibility
(
View
.
VISIBLE
);
mCoverImageView
.
setVisibility
(
View
.
INVISIBLE
);
mBottomProgressBar
.
setVisibility
(
View
.
VISIBLE
);
mLockScreen
.
setVisibility
((
mIfCurrentIsFullscreen
&&
mNeedLockFull
)
?
VISIBLE
:
GONE
);
updateStartImage
();
}
...
...
@@ -498,6 +538,7 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mThumbImageViewLayout
.
setVisibility
(
View
.
INVISIBLE
);
mCoverImageView
.
setVisibility
(
View
.
VISIBLE
);
mBottomProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
mLockScreen
.
setVisibility
((
mIfCurrentIsFullscreen
&&
mNeedLockFull
)
?
VISIBLE
:
GONE
);
updateStartImage
();
}
...
...
@@ -677,6 +718,7 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
if
(
gsyBaseVideoPlayer
!=
null
)
{
StandardGSYVideoPlayer
gsyVideoPlayer
=
(
StandardGSYVideoPlayer
)
gsyBaseVideoPlayer
;
gsyVideoPlayer
.
setStandardVideoAllCallBack
(
mStandardVideoAllCallBack
);
gsyVideoPlayer
.
setNeedLockFull
(
isNeedLockFull
());
}
return
gsyBaseVideoPlayer
;
}
...
...
@@ -727,10 +769,8 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
((
Activity
)
getContext
()).
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
mBottomContainer
.
setVisibility
(
View
.
INVISIBLE
);
mTopContainer
.
setVisibility
(
View
.
INVISIBLE
);
mBottomProgressBar
.
setVisibility
(
View
.
VISIBLE
);
mStartButton
.
setVisibility
(
View
.
INVISIBLE
);
hideAllWidget
();
mLockScreen
.
setVisibility
(
GONE
);
}
});
}
...
...
@@ -738,6 +778,13 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
}
}
private
void
hideAllWidget
()
{
mBottomContainer
.
setVisibility
(
View
.
INVISIBLE
);
mTopContainer
.
setVisibility
(
View
.
INVISIBLE
);
mBottomProgressBar
.
setVisibility
(
View
.
VISIBLE
);
mStartButton
.
setVisibility
(
View
.
INVISIBLE
);
}
private
void
resolveThumbImage
(
View
thumb
)
{
mThumbImageViewLayout
.
addView
(
thumb
);
ViewGroup
.
LayoutParams
layoutParams
=
thumb
.
getLayoutParams
();
...
...
@@ -832,4 +879,17 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
return
mThumbImageViewLayout
;
}
public
boolean
isNeedLockFull
()
{
return
mNeedLockFull
;
}
/**
* 是否需要全屏锁定屏幕功能
*/
public
void
setNeedLockFull
(
boolean
needLoadFull
)
{
this
.
mNeedLockFull
=
needLoadFull
;
}
}
gsyVideoPlayer/src/main/res/drawable-xxhdpi/lock.png
0 → 100644
浏览文件 @
c95acefe
2.5 KB
gsyVideoPlayer/src/main/res/drawable-xxhdpi/unlock.png
0 → 100644
浏览文件 @
c95acefe
2.5 KB
gsyVideoPlayer/src/main/res/layout/video_layout_standard.xml
浏览文件 @
c95acefe
...
...
@@ -154,5 +154,15 @@
android:src=
"@drawable/video_small_close"
android:visibility=
"gone"
/>
<ImageView
android:id=
"@+id/lock_screen"
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"50dp"
android:visibility=
"gone"
android:scaleType=
"centerInside"
android:src=
"@drawable/unlock"
/>
</RelativeLayout>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录