Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
沁852
GSYVideoPlayer
提交
f4b70d02
G
GSYVideoPlayer
项目概览
沁852
/
GSYVideoPlayer
与 Fork 源项目一致
从无法访问的项目Fork
通知
9
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,发现更多精彩内容 >>
提交
f4b70d02
编写于
11月 13, 2016
作者:
S
shuyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix 全屏列表
上级
6ea9eba7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
54 addition
and
16 deletion
+54
-16
app/src/main/java/com/example/gsyvideoplayer/ListVideoActivity.java
...in/java/com/example/gsyvideoplayer/ListVideoActivity.java
+8
-0
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java
...rc/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java
+19
-6
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/StandardGSYVideoPlayer.java
...om/shuyu/gsyvideoplayer/video/StandardGSYVideoPlayer.java
+27
-10
未找到文件。
app/src/main/java/com/example/gsyvideoplayer/ListVideoActivity.java
浏览文件 @
f4b70d02
...
...
@@ -13,6 +13,7 @@ import com.example.gsyvideoplayer.adapter.ListNormalAdapter;
import
com.example.gsyvideoplayer.adapter.ListVideoAdapter
;
import
com.shuyu.gsyvideoplayer.GSYVideoPlayer
;
import
com.shuyu.gsyvideoplayer.utils.ListVideoUtil
;
import
com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
...
...
@@ -49,6 +50,13 @@ public class ListVideoActivity extends AppCompatActivity {
}
@Override
public
void
onBackPressed
()
{
if
(
StandardGSYVideoPlayer
.
backFromWindowFull
(
this
))
{
return
;
}
super
.
onBackPressed
();
}
@Override
protected
void
onDestroy
()
{
...
...
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java
浏览文件 @
f4b70d02
...
...
@@ -84,6 +84,7 @@ public abstract class GSYVideoPlayer extends FrameLayout implements View.OnClick
protected
GSYTextureView
textureView
;
protected
Surface
mSurface
;
protected
Activity
activity
;
protected
ImageView
backButton
;
protected
String
mUrl
;
protected
Object
[]
mObjects
;
...
...
@@ -117,6 +118,9 @@ public abstract class GSYVideoPlayer extends FrameLayout implements View.OnClick
protected
boolean
mLooping
=
false
;
protected
boolean
mCache
=
false
;
protected
boolean
actionBar
;
protected
boolean
statusBar
;
protected
int
mSeekTimePosition
;
public
abstract
int
getLayoutId
();
...
...
@@ -136,6 +140,7 @@ public abstract class GSYVideoPlayer extends FrameLayout implements View.OnClick
protected
void
init
(
Context
context
)
{
View
.
inflate
(
context
,
getLayoutId
(),
this
);
startButton
=
(
ImageView
)
findViewById
(
R
.
id
.
start
);
backButton
=
(
ImageView
)
findViewById
(
R
.
id
.
back
);
fullscreenButton
=
(
ImageView
)
findViewById
(
R
.
id
.
fullscreen
);
progressBar
=
(
SeekBar
)
findViewById
(
R
.
id
.
progress
);
currentTimeTextView
=
(
TextView
)
findViewById
(
R
.
id
.
current
);
...
...
@@ -669,9 +674,7 @@ public abstract class GSYVideoPlayer extends FrameLayout implements View.OnClick
@Override
public
void
onBackFullscreen
()
{
mCurrentState
=
GSYVideoManager
.
instance
().
getLastState
();
setStateAndUi
(
mCurrentState
);
addTextureView
();
}
protected
void
startProgressTimer
()
{
...
...
@@ -779,9 +782,9 @@ public abstract class GSYVideoPlayer extends FrameLayout implements View.OnClick
&&
GSYVideoManager
.
instance
().
listener
()
==
this
;
}
public
void
startWindowFullscreen
(
final
Context
context
,
final
boolean
actionBar
,
final
boolean
statusBar
)
{
this
.
actionBar
=
actionBar
;
this
.
statusBar
=
statusBar
;
hideSupportActionBar
(
context
,
actionBar
,
statusBar
);
ViewGroup
vp
=
(
ViewGroup
)
(
CommonUtil
.
scanForActivity
(
getContext
())).
findViewById
(
Window
.
ID_ANDROID_CONTENT
);
...
...
@@ -814,6 +817,13 @@ public abstract class GSYVideoPlayer extends FrameLayout implements View.OnClick
clearFullscreenLayout
(
context
,
actionBar
,
statusBar
);
}
});
gsyVideoPlayer
.
getBackButton
().
setVisibility
(
VISIBLE
);
gsyVideoPlayer
.
getBackButton
().
setOnClickListener
(
new
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
clearFullscreenLayout
(
context
,
actionBar
,
statusBar
);
}
});
GSYVideoManager
.
instance
().
setLastListener
(
this
);
GSYVideoManager
.
instance
().
setListener
(
gsyVideoPlayer
);
}
catch
(
InstantiationException
e
)
{
...
...
@@ -844,7 +854,6 @@ public abstract class GSYVideoPlayer extends FrameLayout implements View.OnClick
CLICK_QUIT_FULLSCREEN_TIME
=
System
.
currentTimeMillis
();
}
/**
* 滑动改变亮度
*
...
...
@@ -886,6 +895,10 @@ public abstract class GSYVideoPlayer extends FrameLayout implements View.OnClick
return
fullscreenButton
;
}
public
ImageView
getBackButton
()
{
return
backButton
;
}
public
int
getCurrentState
()
{
return
mCurrentState
;
}
...
...
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/StandardGSYVideoPlayer.java
浏览文件 @
f4b70d02
...
...
@@ -14,6 +14,7 @@ import android.view.View;
import
android.view.ViewGroup
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.widget.FrameLayout
;
import
android.widget.ImageView
;
import
android.widget.ProgressBar
;
import
android.widget.RelativeLayout
;
...
...
@@ -21,14 +22,19 @@ 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
;
import
com.shuyu.gsyvideoplayer.utils.CommonUtil
;
import
java.lang.reflect.Constructor
;
import
java.util.Timer
;
import
java.util.TimerTask
;
import
static
com
.
shuyu
.
gsyvideoplayer
.
utils
.
CommonUtil
.
hideSupportActionBar
;
import
static
com
.
shuyu
.
gsyvideoplayer
.
utils
.
CommonUtil
.
showSupportActionBar
;
/**
* Created by shuyu on 2016/11/11.
*/
...
...
@@ -38,7 +44,6 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
protected
static
Timer
DISSMISS_CONTROL_VIEW_TIMER
;
protected
ImageView
backButton
;
protected
ProgressBar
bottomProgressBar
,
loadingProgressBar
;
protected
TextView
titleTextView
;
protected
RelativeLayout
thumbImageViewLayout
;
...
...
@@ -51,6 +56,11 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
protected
ProgressBar
mDialogVolumeProgressBar
;
protected
StandardVideoAllCallBack
standardVideoAllCallBack
;
protected
Dialog
mProgressDialog
;
protected
ProgressBar
mDialogProgressBar
;
protected
TextView
mDialogSeekTime
;
protected
TextView
mDialogTotalTime
;
protected
ImageView
mDialogIcon
;
protected
DismissControlViewTimerTask
mDismissControlViewTimerTask
;
...
...
@@ -73,7 +83,6 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
super
.
init
(
context
);
bottomProgressBar
=
(
ProgressBar
)
findViewById
(
R
.
id
.
bottom_progressbar
);
titleTextView
=
(
TextView
)
findViewById
(
R
.
id
.
title
);
backButton
=
(
ImageView
)
findViewById
(
R
.
id
.
back
);
thumbImageViewLayout
=
(
RelativeLayout
)
findViewById
(
R
.
id
.
thumb
);
coverImageView
=
(
ImageView
)
findViewById
(
R
.
id
.
cover
);
loadingProgressBar
=
(
ProgressBar
)
findViewById
(
R
.
id
.
loading
);
...
...
@@ -423,12 +432,6 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
}
}
protected
Dialog
mProgressDialog
;
protected
ProgressBar
mDialogProgressBar
;
protected
TextView
mDialogSeekTime
;
protected
TextView
mDialogTotalTime
;
protected
ImageView
mDialogIcon
;
@Override
protected
void
showProgressDialog
(
float
deltaX
,
String
seekTime
,
int
seekTimePosition
,
String
totalTime
,
int
totalTimeDuration
)
{
super
.
showProgressDialog
(
deltaX
,
seekTime
,
seekTimePosition
,
totalTime
,
totalTimeDuration
);
...
...
@@ -607,7 +610,21 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
return
titleTextView
;
}
public
ImageView
getBackButton
()
{
return
backButton
;
@Override
public
void
onBackFullscreen
()
{
clearFullscreenLayout
(
getContext
(),
actionBar
,
statusBar
);
}
public
static
boolean
backFromWindowFull
(
Context
context
)
{
boolean
backFrom
=
false
;
ViewGroup
vp
=
(
ViewGroup
)
(
CommonUtil
.
scanForActivity
(
context
)).
findViewById
(
Window
.
ID_ANDROID_CONTENT
);
View
oldF
=
vp
.
findViewById
(
FULLSCREEN_ID
);
if
(
oldF
!=
null
)
{
backFrom
=
true
;
GSYVideoManager
.
instance
().
lastListener
().
onBackFullscreen
();
}
return
backFrom
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录