Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ac13
GSYVideoPlayer
提交
25c14ff8
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 搜索 >>
提交
25c14ff8
编写于
12月 23, 2016
作者:
S
shuyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加了不同类似布局的实现方法
上级
4ed74bdf
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
275 addition
and
4 deletion
+275
-4
app/src/main/java/com/example/gsyvideoplayer/DetailPlayer.java
...rc/main/java/com/example/gsyvideoplayer/DetailPlayer.java
+2
-1
app/src/main/java/com/example/gsyvideoplayer/video/LandLayoutVideo.java
...ava/com/example/gsyvideoplayer/video/LandLayoutVideo.java
+37
-0
app/src/main/java/com/example/gsyvideoplayer/video/SampleVideo.java
...in/java/com/example/gsyvideoplayer/video/SampleVideo.java
+7
-0
app/src/main/res/layout/activity_detail_player.xml
app/src/main/res/layout/activity_detail_player.xml
+1
-1
app/src/main/res/layout/sample_video_land.xml
app/src/main/res/layout/sample_video_land.xml
+190
-0
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java
...rc/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java
+8
-0
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/CustomGSYVideoPlayer.java
.../com/shuyu/gsyvideoplayer/video/CustomGSYVideoPlayer.java
+7
-0
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/GSYBaseVideoPlayer.java
...va/com/shuyu/gsyvideoplayer/video/GSYBaseVideoPlayer.java
+9
-2
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/ListGSYVideoPlayer.java
...va/com/shuyu/gsyvideoplayer/video/ListGSYVideoPlayer.java
+7
-0
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/StandardGSYVideoPlayer.java
...om/shuyu/gsyvideoplayer/video/StandardGSYVideoPlayer.java
+7
-0
未找到文件。
app/src/main/java/com/example/gsyvideoplayer/DetailPlayer.java
浏览文件 @
25c14ff8
...
...
@@ -10,6 +10,7 @@ import android.widget.ImageView;
import
android.widget.RelativeLayout
;
import
com.example.gsyvideoplayer.listener.SampleListener
;
import
com.example.gsyvideoplayer.video.LandLayoutVideo
;
import
com.shuyu.gsyvideoplayer.GSYPreViewManager
;
import
com.shuyu.gsyvideoplayer.GSYVideoPlayer
;
...
...
@@ -31,7 +32,7 @@ public class DetailPlayer extends AppCompatActivity {
//推荐使用StandardGSYVideoPlayer,功能一致
//CustomGSYVideoPlayer部分功能处于试验阶段
@BindView
(
R
.
id
.
detail_player
)
CustomGSYVideoPlayer
detailPlayer
;
LandLayoutVideo
detailPlayer
;
@BindView
(
R
.
id
.
activity_detail_player
)
RelativeLayout
activityDetailPlayer
;
...
...
app/src/main/java/com/example/gsyvideoplayer/video/LandLayoutVideo.java
0 → 100644
浏览文件 @
25c14ff8
package
com.example.gsyvideoplayer.video
;
import
android.content.Context
;
import
android.util.AttributeSet
;
import
com.example.gsyvideoplayer.R
;
/**
* Created by shuyu on 2016/12/23.
*/
public
class
LandLayoutVideo
extends
SampleVideo
{
/**
* 1.5开始加入,必须重载
*/
public
LandLayoutVideo
(
Context
context
,
Boolean
fullFlag
)
{
super
(
context
,
fullFlag
);
}
public
LandLayoutVideo
(
Context
context
)
{
super
(
context
);
}
public
LandLayoutVideo
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
}
@Override
public
int
getLayoutId
()
{
if
(
mIfCurrentIsFullscreen
)
{
return
R
.
layout
.
sample_video_land
;
}
return
R
.
layout
.
sample_video
;
}
}
app/src/main/java/com/example/gsyvideoplayer/video/SampleVideo.java
浏览文件 @
25c14ff8
...
...
@@ -46,6 +46,13 @@ public class SampleVideo extends StandardGSYVideoPlayer {
//数据源
private
int
mSourcePosition
=
0
;
/**
* 1.5开始加入,必须重载
*/
public
SampleVideo
(
Context
context
,
Boolean
fullFlag
)
{
super
(
context
,
fullFlag
);
}
public
SampleVideo
(
Context
context
)
{
super
(
context
);
}
...
...
app/src/main/res/layout/activity_detail_player.xml
浏览文件 @
25c14ff8
...
...
@@ -29,7 +29,7 @@
</android.support.v4.widget.NestedScrollView>
<com.
shuyu.gsyvideoplayer.video.CustomGSYVideoPlayer
<com.
example.gsyvideoplayer.video.LandLayoutVideo
android:id=
"@+id/detail_player"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/post_media_height"
/>
...
...
app/src/main/res/layout/sample_video_land.xml
0 → 100644
浏览文件 @
25c14ff8
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@android:color/black"
>
<RelativeLayout
android:id=
"@+id/surface_container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:gravity=
"center"
>
</RelativeLayout>
<com.shuyu.gsyvideoplayer.GSYImageCover
android:id=
"@+id/cover"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_centerInParent=
"true"
android:scaleType=
"fitXY"
/>
<RelativeLayout
android:id=
"@+id/thumb"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_alignParentBottom=
"true"
android:layout_alignParentEnd=
"true"
android:layout_alignParentLeft=
"true"
android:layout_alignParentRight=
"true"
android:layout_alignParentStart=
"true"
android:layout_alignParentTop=
"true"
android:background=
"#000000"
android:scaleType=
"fitCenter"
/>
<LinearLayout
android:id=
"@+id/layout_bottom"
android:layout_width=
"match_parent"
android:layout_height=
"70dp"
android:layout_alignParentBottom=
"true"
android:background=
"#99000000"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:visibility=
"invisible"
>
<moe.codeest.enviews.ENPlayView
android:id=
"@+id/start"
android:layout_width=
"60dp"
android:layout_height=
"60dp"
android:layout_centerHorizontal=
"true"
android:layout_centerVertical=
"true"
android:layout_gravity=
"center_vertical"
android:layout_marginLeft=
"10dp"
/>
<TextView
android:id=
"@+id/current"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"16dp"
android:text=
"00:00"
android:textColor=
"#ffffff"
/>
<SeekBar
android:id=
"@+id/progress"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_weight=
"1.0"
android:background=
"@null"
android:max=
"100"
android:maxHeight=
"4dp"
android:minHeight=
"4dp"
android:paddingBottom=
"8dp"
android:paddingTop=
"8dp"
android:progressDrawable=
"@drawable/video_seek_progress"
android:thumb=
"@drawable/video_seek_thumb"
/>
<TextView
android:id=
"@+id/total"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"16dp"
android:text=
"00:00"
android:textColor=
"#ffffff"
/>
<TextView
android:id=
"@+id/switchSize"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_marginRight=
"16dp"
android:gravity=
"center"
android:minEms=
"2"
android:text=
"标准"
android:textColor=
"#ffffff"
/>
<ImageView
android:id=
"@+id/fullscreen"
android:layout_width=
"wrap_content"
android:layout_height=
"fill_parent"
android:paddingRight=
"16dp"
android:scaleType=
"center"
android:src=
"@drawable/video_enlarge"
/>
</LinearLayout>
<ProgressBar
android:id=
"@+id/bottom_progressbar"
style=
"?android:attr/progressBarStyleHorizontal"
android:layout_width=
"match_parent"
android:layout_height=
"1.5dp"
android:layout_alignParentBottom=
"true"
android:max=
"100"
android:progressDrawable=
"@drawable/video_progress"
/>
<ImageView
android:id=
"@+id/back_tiny"
android:layout_width=
"24dp"
android:layout_height=
"24dp"
android:layout_marginLeft=
"6dp"
android:layout_marginTop=
"6dp"
android:visibility=
"gone"
/>
<moe.codeest.enviews.ENDownloadView
android:id=
"@+id/loading"
android:layout_width=
"28dp"
android:layout_height=
"28dp"
android:layout_centerHorizontal=
"true"
android:layout_centerVertical=
"true"
android:visibility=
"invisible"
/>
<ImageView
android:id=
"@+id/small_close"
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:paddingLeft=
"10dp"
android:paddingTop=
"10dp"
android:scaleType=
"centerInside"
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:scaleType=
"centerInside"
android:src=
"@drawable/unlock"
android:visibility=
"gone"
/>
<LinearLayout
android:id=
"@+id/layout_top"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:layout_alignParentTop=
"true"
android:layout_toEndOf=
"@+id/back_tiny"
android:layout_toRightOf=
"@+id/back_tiny"
android:background=
"@drawable/video_title_bg"
android:gravity=
"center_vertical"
>
<ImageView
android:id=
"@+id/back"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:paddingLeft=
"10dp"
android:scaleType=
"centerInside"
android:src=
"@drawable/video_back"
/>
<TextView
android:id=
"@+id/title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:paddingLeft=
"10dp"
android:textColor=
"@android:color/white"
android:textSize=
"18sp"
/>
<TextView
android:id=
"@+id/moreScale"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:minEms=
"5"
android:paddingLeft=
"10dp"
android:text=
"默认比例"
android:textColor=
"@android:color/white"
android:textSize=
"13sp"
/>
</LinearLayout>
</RelativeLayout>
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java
浏览文件 @
25c14ff8
...
...
@@ -132,6 +132,14 @@ public abstract class GSYVideoPlayer extends GSYBaseVideoPlayer implements View.
*/
public
abstract
void
startPlayLogic
();
/**
* 1.5开始加入,必须重载
*/
public
GSYVideoPlayer
(
Context
context
,
Boolean
fullFlag
)
{
super
(
context
,
fullFlag
);
init
(
context
);
}
public
GSYVideoPlayer
(
Context
context
)
{
super
(
context
);
init
(
context
);
...
...
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/CustomGSYVideoPlayer.java
浏览文件 @
25c14ff8
...
...
@@ -32,6 +32,13 @@ public class CustomGSYVideoPlayer extends StandardGSYVideoPlayer {
private
int
mPreProgress
=
-
2
;
/**
* 1.5开始加入,必须重载
*/
public
CustomGSYVideoPlayer
(
Context
context
,
Boolean
fullFlag
)
{
super
(
context
,
fullFlag
);
}
public
CustomGSYVideoPlayer
(
Context
context
)
{
super
(
context
);
}
...
...
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/GSYBaseVideoPlayer.java
浏览文件 @
25c14ff8
...
...
@@ -128,6 +128,13 @@ public abstract class GSYBaseVideoPlayer extends FrameLayout implements GSYMedia
private
Handler
mHandler
=
new
Handler
();
/**
* 1.5开始加入,必须重载
*/
public
GSYBaseVideoPlayer
(
Context
context
,
Boolean
fullFlag
)
{
super
(
context
);
mIfCurrentIsFullscreen
=
fullFlag
;
}
public
GSYBaseVideoPlayer
(
Context
context
)
{
super
(
context
);
...
...
@@ -287,8 +294,8 @@ public abstract class GSYBaseVideoPlayer extends FrameLayout implements GSYMedia
saveLocationStatus
(
context
,
statusBar
,
actionBar
);
try
{
Constructor
<
GSYBaseVideoPlayer
>
constructor
=
(
Constructor
<
GSYBaseVideoPlayer
>)
GSYBaseVideoPlayer
.
this
.
getClass
().
getConstructor
(
Context
.
class
);
final
GSYBaseVideoPlayer
gsyVideoPlayer
=
constructor
.
newInstance
(
getContext
());
Constructor
<
GSYBaseVideoPlayer
>
constructor
=
(
Constructor
<
GSYBaseVideoPlayer
>)
GSYBaseVideoPlayer
.
this
.
getClass
().
getConstructor
(
Context
.
class
,
Boolean
.
class
);
final
GSYBaseVideoPlayer
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
浏览文件 @
25c14ff8
...
...
@@ -19,6 +19,13 @@ public class ListGSYVideoPlayer extends StandardGSYVideoPlayer {
protected
List
<
GSYVideoModel
>
mUriList
=
new
ArrayList
<>();
protected
int
mPlayPosition
;
/**
* 1.5开始加入,必须重载
*/
public
ListGSYVideoPlayer
(
Context
context
,
Boolean
fullFlag
)
{
super
(
context
,
fullFlag
);
}
public
ListGSYVideoPlayer
(
Context
context
)
{
super
(
context
);
}
...
...
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/StandardGSYVideoPlayer.java
浏览文件 @
25c14ff8
...
...
@@ -102,6 +102,13 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
setVideoAllCallBack
(
standardVideoAllCallBack
);
}
/**
* 1.5开始加入,必须重载
*/
public
StandardGSYVideoPlayer
(
Context
context
,
Boolean
fullFlag
)
{
super
(
context
,
fullFlag
);
}
public
StandardGSYVideoPlayer
(
Context
context
)
{
super
(
context
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录