Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
沁852
GSYVideoPlayer
提交
bc2a9852
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,体验更适合开发者的 AI 搜索 >>
提交
bc2a9852
编写于
12月 23, 2016
作者:
S
shuyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.5.0 增加了全屏布局和普通布局的兼容支持
上级
25c14ff8
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
89 addition
and
28 deletion
+89
-28
app/src/main/java/com/example/gsyvideoplayer/video/LandLayoutVideo.java
...ava/com/example/gsyvideoplayer/video/LandLayoutVideo.java
+26
-3
app/src/main/java/com/example/gsyvideoplayer/video/SampleVideo.java
...in/java/com/example/gsyvideoplayer/video/SampleVideo.java
+1
-1
app/src/main/res/layout/sample_video_land.xml
app/src/main/res/layout/sample_video_land.xml
+5
-4
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java
...rc/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java
+1
-1
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/CustomGSYVideoPlayer.java
.../com/shuyu/gsyvideoplayer/video/CustomGSYVideoPlayer.java
+1
-1
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/GSYBaseVideoPlayer.java
...va/com/shuyu/gsyvideoplayer/video/GSYBaseVideoPlayer.java
+20
-3
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/ListGSYVideoPlayer.java
...va/com/shuyu/gsyvideoplayer/video/ListGSYVideoPlayer.java
+1
-1
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/StandardGSYVideoPlayer.java
...om/shuyu/gsyvideoplayer/video/StandardGSYVideoPlayer.java
+34
-14
未找到文件。
app/src/main/java/com/example/gsyvideoplayer/video/LandLayoutVideo.java
浏览文件 @
bc2a9852
...
...
@@ -2,17 +2,21 @@ package com.example.gsyvideoplayer.video;
import
android.content.Context
;
import
android.util.AttributeSet
;
import
android.widget.ImageView
;
import
com.example.gsyvideoplayer.R
;
import
com.shuyu.gsyvideoplayer.video.CustomGSYVideoPlayer
;
import
moe.codeest.enviews.ENPlayView
;
/**
* Created by shuyu on 2016/12/23.
* CustomGSYVideoPlayer是试验中,建议使用的时候使用StandardGSYVideoPlayer
*/
public
class
LandLayoutVideo
extends
SampleVideo
{
public
class
LandLayoutVideo
extends
CustomGSYVideoPlayer
{
/**
* 1.5
开始加入,必须
重载
* 1.5
.0开始加入,如果需要不同布局区分功能,需要
重载
*/
public
LandLayoutVideo
(
Context
context
,
Boolean
fullFlag
)
{
super
(
context
,
fullFlag
);
...
...
@@ -26,6 +30,8 @@ public class LandLayoutVideo extends SampleVideo {
super
(
context
,
attrs
);
}
//这个必须配置最上面的构造才能生效
@Override
public
int
getLayoutId
()
{
if
(
mIfCurrentIsFullscreen
)
{
...
...
@@ -34,4 +40,21 @@ public class LandLayoutVideo extends SampleVideo {
return
R
.
layout
.
sample_video
;
}
@Override
protected
void
updateStartImage
()
{
if
(
mIfCurrentIsFullscreen
)
{
ImageView
imageView
=
(
ImageView
)
mStartButton
;
if
(
mCurrentState
==
CURRENT_STATE_PLAYING
)
{
imageView
.
setImageResource
(
R
.
drawable
.
video_click_pause_selector
);
}
else
if
(
mCurrentState
==
CURRENT_STATE_ERROR
)
{
imageView
.
setImageResource
(
R
.
drawable
.
video_click_play_selector
);
}
else
{
imageView
.
setImageResource
(
R
.
drawable
.
video_click_play_selector
);
}
}
else
{
super
.
updateStartImage
();
}
}
}
app/src/main/java/com/example/gsyvideoplayer/video/SampleVideo.java
浏览文件 @
bc2a9852
...
...
@@ -47,7 +47,7 @@ public class SampleVideo extends StandardGSYVideoPlayer {
private
int
mSourcePosition
=
0
;
/**
* 1.5
开始加入,必须
重载
* 1.5
.0开始加入,如果需要不同布局区分功能,需要
重载
*/
public
SampleVideo
(
Context
context
,
Boolean
fullFlag
)
{
super
(
context
,
fullFlag
);
...
...
app/src/main/res/layout/sample_video_land.xml
浏览文件 @
bc2a9852
...
...
@@ -35,17 +35,18 @@
<LinearLayout
android:id=
"@+id/layout_bottom"
android:layout_width=
"match_parent"
android:layout_height=
"
7
0dp"
android:layout_height=
"
4
0dp"
android:layout_alignParentBottom=
"true"
android:background=
"#99000000"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:visibility=
"invisible"
>
<
moe.codeest.enviews.ENPlay
View
<
Image
View
android:id=
"@+id/start"
android:layout_width=
"60dp"
android:layout_height=
"60dp"
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:src=
"@drawable/video_click_play_selector"
android:layout_centerHorizontal=
"true"
android:layout_centerVertical=
"true"
android:layout_gravity=
"center_vertical"
...
...
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java
浏览文件 @
bc2a9852
...
...
@@ -133,7 +133,7 @@ public abstract class GSYVideoPlayer extends GSYBaseVideoPlayer implements View.
public
abstract
void
startPlayLogic
();
/**
* 1.5
开始加入,必须
重载
* 1.5
.0开始加入,如果需要不同布局区分功能,需要
重载
*/
public
GSYVideoPlayer
(
Context
context
,
Boolean
fullFlag
)
{
super
(
context
,
fullFlag
);
...
...
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/CustomGSYVideoPlayer.java
浏览文件 @
bc2a9852
...
...
@@ -33,7 +33,7 @@ public class CustomGSYVideoPlayer extends StandardGSYVideoPlayer {
private
int
mPreProgress
=
-
2
;
/**
* 1.5
开始加入,必须
重载
* 1.5
.0开始加入,如果需要不同布局区分功能,需要
重载
*/
public
CustomGSYVideoPlayer
(
Context
context
,
Boolean
fullFlag
)
{
super
(
context
,
fullFlag
);
...
...
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/GSYBaseVideoPlayer.java
浏览文件 @
bc2a9852
...
...
@@ -129,7 +129,7 @@ public abstract class GSYBaseVideoPlayer extends FrameLayout implements GSYMedia
private
Handler
mHandler
=
new
Handler
();
/**
* 1.5
开始加入,必须
重载
* 1.5
.0开始加入,如果需要不同布局区分功能,需要
重载
*/
public
GSYBaseVideoPlayer
(
Context
context
,
Boolean
fullFlag
)
{
super
(
context
);
...
...
@@ -293,9 +293,26 @@ public abstract class GSYBaseVideoPlayer extends FrameLayout implements GSYMedia
saveLocationStatus
(
context
,
statusBar
,
actionBar
);
boolean
hadNewConstructor
=
true
;
try
{
GSYBaseVideoPlayer
.
this
.
getClass
().
getConstructor
(
Context
.
class
,
Boolean
.
class
);
}
catch
(
Exception
e
)
{
hadNewConstructor
=
false
;
}
try
{
Constructor
<
GSYBaseVideoPlayer
>
constructor
=
(
Constructor
<
GSYBaseVideoPlayer
>)
GSYBaseVideoPlayer
.
this
.
getClass
().
getConstructor
(
Context
.
class
,
Boolean
.
class
);
final
GSYBaseVideoPlayer
gsyVideoPlayer
=
constructor
.
newInstance
(
getContext
(),
true
);
//通过被重载的不同构造器来选择
Constructor
<
GSYBaseVideoPlayer
>
constructor
;
final
GSYBaseVideoPlayer
gsyVideoPlayer
;
if
(!
hadNewConstructor
)
{
constructor
=
(
Constructor
<
GSYBaseVideoPlayer
>)
GSYBaseVideoPlayer
.
this
.
getClass
().
getConstructor
(
Context
.
class
);
gsyVideoPlayer
=
constructor
.
newInstance
(
getContext
());
}
else
{
constructor
=
(
Constructor
<
GSYBaseVideoPlayer
>)
GSYBaseVideoPlayer
.
this
.
getClass
().
getConstructor
(
Context
.
class
,
Boolean
.
class
);
gsyVideoPlayer
=
constructor
.
newInstance
(
getContext
(),
true
);
}
gsyVideoPlayer
.
setId
(
FULLSCREEN_ID
);
gsyVideoPlayer
.
setIfCurrentIsFullscreen
(
true
);
gsyVideoPlayer
.
setVideoAllCallBack
(
mVideoAllCallBack
);
...
...
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/ListGSYVideoPlayer.java
浏览文件 @
bc2a9852
...
...
@@ -20,7 +20,7 @@ public class ListGSYVideoPlayer extends StandardGSYVideoPlayer {
protected
int
mPlayPosition
;
/**
* 1.5
开始加入,必须
重载
* 1.5
.0开始加入,如果需要不同布局区分功能,需要
重载
*/
public
ListGSYVideoPlayer
(
Context
context
,
Boolean
fullFlag
)
{
super
(
context
,
fullFlag
);
...
...
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/StandardGSYVideoPlayer.java
浏览文件 @
bc2a9852
...
...
@@ -51,7 +51,7 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
protected
ProgressBar
mBottomProgressBar
;
private
ENDownload
View
mLoadingProgressBar
;
private
View
mLoadingProgressBar
;
protected
TextView
mTitleTextView
;
//title
...
...
@@ -103,7 +103,7 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
}
/**
* 1.5
开始加入,必须
重载
* 1.5
.0开始加入,如果需要不同布局区分功能,需要
重载
*/
public
StandardGSYVideoPlayer
(
Context
context
,
Boolean
fullFlag
)
{
super
(
context
,
fullFlag
);
...
...
@@ -125,7 +125,7 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mThumbImageViewLayout
=
(
RelativeLayout
)
findViewById
(
R
.
id
.
thumb
);
mLockScreen
=
(
ImageView
)
findViewById
(
R
.
id
.
lock_screen
);
mLoadingProgressBar
=
(
ENDownloadView
)
findViewById
(
R
.
id
.
loading
);
mLoadingProgressBar
=
findViewById
(
R
.
id
.
loading
);
mThumbImageViewLayout
.
setVisibility
(
GONE
);
mThumbImageViewLayout
.
setOnClickListener
(
this
);
...
...
@@ -420,7 +420,9 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mBottomContainer
.
setVisibility
(
View
.
INVISIBLE
);
mStartButton
.
setVisibility
(
View
.
VISIBLE
);
mLoadingProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
mLoadingProgressBar
.
reset
();
if
(
mLoadingProgressBar
instanceof
ENDownloadView
)
{
((
ENDownloadView
)
mLoadingProgressBar
).
reset
();
}
mThumbImageViewLayout
.
setVisibility
(
View
.
VISIBLE
);
mCoverImageView
.
setVisibility
(
View
.
VISIBLE
);
mBottomProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
...
...
@@ -434,7 +436,9 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mBottomContainer
.
setVisibility
(
View
.
VISIBLE
);
mStartButton
.
setVisibility
(
View
.
INVISIBLE
);
mLoadingProgressBar
.
setVisibility
(
View
.
VISIBLE
);
mLoadingProgressBar
.
start
();
if
(
mLoadingProgressBar
instanceof
ENDownloadView
)
{
((
ENDownloadView
)
mLoadingProgressBar
).
start
();
}
mThumbImageViewLayout
.
setVisibility
(
View
.
INVISIBLE
);
mCoverImageView
.
setVisibility
(
View
.
VISIBLE
);
mBottomProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
...
...
@@ -458,7 +462,9 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mBottomContainer
.
setVisibility
(
View
.
VISIBLE
);
mStartButton
.
setVisibility
(
View
.
VISIBLE
);
mLoadingProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
mLoadingProgressBar
.
reset
();
if
(
mLoadingProgressBar
instanceof
ENDownloadView
)
{
((
ENDownloadView
)
mLoadingProgressBar
).
reset
();
}
mThumbImageViewLayout
.
setVisibility
(
View
.
INVISIBLE
);
mCoverImageView
.
setVisibility
(
View
.
INVISIBLE
);
mBottomProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
...
...
@@ -478,7 +484,9 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mBottomContainer
.
setVisibility
(
View
.
VISIBLE
);
mStartButton
.
setVisibility
(
View
.
VISIBLE
);
mLoadingProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
mLoadingProgressBar
.
reset
();
if
(
mLoadingProgressBar
instanceof
ENDownloadView
)
{
((
ENDownloadView
)
mLoadingProgressBar
).
reset
();
}
mThumbImageViewLayout
.
setVisibility
(
View
.
INVISIBLE
);
//mCoverImageView.setVisibility(View.INVISIBLE);
mBottomProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
...
...
@@ -500,7 +508,9 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mBottomContainer
.
setVisibility
(
View
.
VISIBLE
);
mStartButton
.
setVisibility
(
View
.
INVISIBLE
);
mLoadingProgressBar
.
setVisibility
(
View
.
VISIBLE
);
mLoadingProgressBar
.
start
();
if
(
mLoadingProgressBar
instanceof
ENDownloadView
)
{
((
ENDownloadView
)
mLoadingProgressBar
).
start
();
}
mThumbImageViewLayout
.
setVisibility
(
View
.
INVISIBLE
);
mCoverImageView
.
setVisibility
(
View
.
INVISIBLE
);
mBottomProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
...
...
@@ -513,7 +523,9 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mBottomContainer
.
setVisibility
(
View
.
INVISIBLE
);
mStartButton
.
setVisibility
(
View
.
INVISIBLE
);
mLoadingProgressBar
.
setVisibility
(
View
.
VISIBLE
);
mLoadingProgressBar
.
start
();
if
(
mLoadingProgressBar
instanceof
ENDownloadView
)
{
((
ENDownloadView
)
mLoadingProgressBar
).
start
();
}
mThumbImageViewLayout
.
setVisibility
(
View
.
INVISIBLE
);
mCoverImageView
.
setVisibility
(
View
.
INVISIBLE
);
mBottomProgressBar
.
setVisibility
(
View
.
VISIBLE
);
...
...
@@ -527,7 +539,9 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mBottomContainer
.
setVisibility
(
View
.
INVISIBLE
);
mStartButton
.
setVisibility
(
View
.
INVISIBLE
);
mLoadingProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
mLoadingProgressBar
.
reset
();
if
(
mLoadingProgressBar
instanceof
ENDownloadView
)
{
((
ENDownloadView
)
mLoadingProgressBar
).
reset
();
}
mThumbImageViewLayout
.
setVisibility
(
View
.
INVISIBLE
);
mCoverImageView
.
setVisibility
(
View
.
INVISIBLE
);
mBottomProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
...
...
@@ -540,7 +554,9 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mBottomContainer
.
setVisibility
(
View
.
VISIBLE
);
mStartButton
.
setVisibility
(
View
.
VISIBLE
);
mLoadingProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
mLoadingProgressBar
.
reset
();
if
(
mLoadingProgressBar
instanceof
ENDownloadView
)
{
((
ENDownloadView
)
mLoadingProgressBar
).
reset
();
}
mThumbImageViewLayout
.
setVisibility
(
View
.
VISIBLE
);
mCoverImageView
.
setVisibility
(
View
.
INVISIBLE
);
mBottomProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
...
...
@@ -554,7 +570,9 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mBottomContainer
.
setVisibility
(
View
.
INVISIBLE
);
mStartButton
.
setVisibility
(
View
.
VISIBLE
);
mLoadingProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
mLoadingProgressBar
.
reset
();
if
(
mLoadingProgressBar
instanceof
ENDownloadView
)
{
((
ENDownloadView
)
mLoadingProgressBar
).
reset
();
}
mThumbImageViewLayout
.
setVisibility
(
View
.
VISIBLE
);
mCoverImageView
.
setVisibility
(
View
.
INVISIBLE
);
mBottomProgressBar
.
setVisibility
(
View
.
VISIBLE
);
...
...
@@ -568,7 +586,9 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
mBottomContainer
.
setVisibility
(
View
.
INVISIBLE
);
mStartButton
.
setVisibility
(
View
.
VISIBLE
);
mLoadingProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
mLoadingProgressBar
.
reset
();
if
(
mLoadingProgressBar
instanceof
ENDownloadView
)
{
((
ENDownloadView
)
mLoadingProgressBar
).
reset
();
}
mThumbImageViewLayout
.
setVisibility
(
View
.
INVISIBLE
);
mCoverImageView
.
setVisibility
(
View
.
VISIBLE
);
mBottomProgressBar
.
setVisibility
(
View
.
INVISIBLE
);
...
...
@@ -576,7 +596,7 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
updateStartImage
();
}
pr
ivate
void
updateStartImage
()
{
pr
otected
void
updateStartImage
()
{
ENPlayView
enPlayView
=
(
ENPlayView
)
mStartButton
;
enPlayView
.
setDuration
(
500
);
if
(
mCurrentState
==
CURRENT_STATE_PLAYING
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录