Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
沁852
GSYVideoPlayer
提交
bff66811
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 搜索 >>
提交
bff66811
编写于
12月 11, 2016
作者:
S
shuyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.4.6 修正了预览
上级
a5346727
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
49 addition
and
10 deletion
+49
-10
07.gif
07.gif
+0
-0
README.md
README.md
+13
-0
app/src/main/java/com/example/gsyvideoplayer/DetailPlayer.java
...rc/main/java/com/example/gsyvideoplayer/DetailPlayer.java
+1
-4
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java
...rc/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java
+0
-2
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/CustomGSYVideoPlayer.java
.../com/shuyu/gsyvideoplayer/video/CustomGSYVideoPlayer.java
+32
-4
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/GSYBaseVideoPlayer.java
...va/com/shuyu/gsyvideoplayer/video/GSYBaseVideoPlayer.java
+3
-0
未找到文件。
07.gif
0 → 100644
浏览文件 @
bff66811
1.2 MB
README.md
浏览文件 @
bff66811
...
...
@@ -16,6 +16,7 @@
*
**调整显示比例:默认、16:9、4:3。**
*
**调整不同清晰度的支持。**
*
**支持IJKPlayer和EXOPlayer切换。**
*
**进度条小窗口预览。**
## [简书详解入口](http://www.jianshu.com/p/9fe377dd9750)
...
...
@@ -65,13 +66,25 @@ dependencies {
<img
src=
"https://github.com/CarGuo/GSYVideoPlayer/blob/master/05.gif"
width=
"240px"
height=
"426px"
/>
<img
src=
"https://github.com/CarGuo/GSYVideoPlayer/blob/master/04.gif"
width=
"240px"
height=
"426px"
/>
*
### 3、进度条小窗口预览
<img
src=
"https://github.com/CarGuo/GSYVideoPlayer/blob/master/07.gif"
width=
"426px"
height=
"240px"
/>
## 下方个版本说明,可以当做简单的wiki使用~,效果可参考DEMO。
### 1.4.6
*
修改了某些虚拟按键手机下,全屏后返回导致界面显示不正的问题。
*
增加CustomGSYVideoPlayer,实现滑动进度条预览效果。
注:网目前对已完全缓存的视频,或者本地文件支持好一些,对纯网络视频支持较差。
```
/**
* 是否打开滑动预览,对已缓存文件默认生效
* 如果是本地文件需要设置打开,默认关闭
*/
public void setOpenPreView(boolean localFile)
```
### 1.4.5
*
支持切换IJKPlayer和EXOPlayer,不过EXOPlayer后台播放回到前台黑的问题除了seekto无解啊。
...
...
app/src/main/java/com/example/gsyvideoplayer/DetailPlayer.java
浏览文件 @
bff66811
...
...
@@ -43,7 +43,7 @@ public class DetailPlayer extends AppCompatActivity {
ButterKnife
.
bind
(
this
);
String
url
=
"http://baobab.wdjcdn.com/14564977406580.mp4"
;
detailPlayer
.
setUp
(
url
,
fals
e
,
null
,
"测试视频"
);
detailPlayer
.
setUp
(
url
,
tru
e
,
null
,
"测试视频"
);
//增加封面
ImageView
imageView
=
new
ImageView
(
this
);
...
...
@@ -71,9 +71,6 @@ public class DetailPlayer extends AppCompatActivity {
//第一个true是否需要隐藏actionbar,第二个true是否需要隐藏statusbar
detailPlayer
.
startWindowFullscreen
(
DetailPlayer
.
this
,
true
,
true
);
//这是以前旧的方式
//toDo();
}
});
...
...
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java
浏览文件 @
bff66811
...
...
@@ -124,8 +124,6 @@ public abstract class GSYVideoPlayer extends GSYBaseVideoPlayer implements View.
protected
boolean
mFirstTouch
=
false
;
//是否首次触摸
protected
boolean
mCacheFile
=
false
;
//是否是缓存的文件
/**
* 当前UI
...
...
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/CustomGSYVideoPlayer.java
浏览文件 @
bff66811
...
...
@@ -2,7 +2,6 @@ package com.shuyu.gsyvideoplayer.video;
import
android.content.Context
;
import
android.graphics.SurfaceTexture
;
import
android.os.Handler
;
import
android.util.AttributeSet
;
import
android.view.Surface
;
import
android.view.TextureView
;
...
...
@@ -13,7 +12,6 @@ import android.widget.SeekBar;
import
com.shuyu.gsyvideoplayer.GSYPreViewManager
;
import
com.shuyu.gsyvideoplayer.GSYTextureView
;
import
com.shuyu.gsyvideoplayer.R
;
import
com.shuyu.gsyvideoplayer.utils.Debuger
;
/**
* Created by shuyu on 2016/12/10.
...
...
@@ -28,6 +26,11 @@ public class CustomGSYVideoPlayer extends StandardGSYVideoPlayer {
//是否因为用户点击
private
boolean
mIsFromUser
;
//是否打开滑动预览
private
boolean
mOpenPreView
;
private
int
mPreProgress
=
-
2
;
public
CustomGSYVideoPlayer
(
Context
context
)
{
super
(
context
);
initView
();
...
...
@@ -104,10 +107,11 @@ public class CustomGSYVideoPlayer extends StandardGSYVideoPlayer {
layoutParams
.
leftMargin
=
offset
;
//设置帧预览图的显示位置
mPreviewLayout
.
setLayoutParams
(
layoutParams
);
if
(
GSYPreViewManager
.
instance
().
getMediaPlayer
()
!=
null
&&
mHadPlay
)
{
if
(
GSYPreViewManager
.
instance
().
getMediaPlayer
()
!=
null
&&
mHadPlay
&&
Math
.
abs
(
progress
-
mPreProgress
)
>
2
&&
(
mCacheFile
||
mOpenPreView
))
{
int
time
=
progress
*
getDuration
()
/
100
;
Debuger
.
printfLog
(
"SEEK TO "
+
time
);
GSYPreViewManager
.
instance
().
getMediaPlayer
().
seekTo
(
time
);
mPreProgress
=
progress
;
}
}
}
...
...
@@ -117,10 +121,14 @@ public class CustomGSYVideoPlayer extends StandardGSYVideoPlayer {
super
.
onStartTrackingTouch
(
seekBar
);
mIsFromUser
=
true
;
mPreviewLayout
.
setVisibility
(
VISIBLE
);
mPreProgress
=
-
2
;
}
@Override
public
void
onStopTrackingTouch
(
SeekBar
seekBar
)
{
if
(
mPreProgress
>=
0
)
{
seekBar
.
setProgress
(
mPreProgress
);
}
super
.
onStopTrackingTouch
(
seekBar
);
mIsFromUser
=
false
;
mPreviewLayout
.
setVisibility
(
GONE
);
...
...
@@ -133,4 +141,24 @@ public class CustomGSYVideoPlayer extends StandardGSYVideoPlayer {
}
super
.
setTextAndProgress
(
secProgress
);
}
@Override
public
GSYBaseVideoPlayer
startWindowFullscreen
(
Context
context
,
boolean
actionBar
,
boolean
statusBar
)
{
GSYBaseVideoPlayer
gsyBaseVideoPlayer
=
super
.
startWindowFullscreen
(
context
,
actionBar
,
statusBar
);
CustomGSYVideoPlayer
customGSYVideoPlayer
=
(
CustomGSYVideoPlayer
)
gsyBaseVideoPlayer
;
customGSYVideoPlayer
.
mOpenPreView
=
mOpenPreView
;
return
gsyBaseVideoPlayer
;
}
public
boolean
isOpenPreView
()
{
return
mOpenPreView
;
}
/**
* 是否打开滑动预览,对已缓存文件默认生效
* 如果是本地文件需要设置打开,默认关闭
*/
public
void
setOpenPreView
(
boolean
localFile
)
{
this
.
mOpenPreView
=
localFile
;
}
}
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/GSYBaseVideoPlayer.java
浏览文件 @
bff66811
...
...
@@ -84,6 +84,8 @@ public abstract class GSYBaseVideoPlayer extends FrameLayout implements GSYMedia
protected
boolean
mHadPlay
=
false
;
//是否播放过
protected
boolean
mCacheFile
=
false
;
//是否是缓存的文件
protected
Context
mContext
;
protected
String
mOriginUrl
;
//原来的url
...
...
@@ -305,6 +307,7 @@ public abstract class GSYBaseVideoPlayer extends FrameLayout implements GSYMedia
resolveFullVideoShow
(
context
,
gsyVideoPlayer
);
}
gsyVideoPlayer
.
mHadPlay
=
mHadPlay
;
gsyVideoPlayer
.
mCacheFile
=
mCacheFile
;
gsyVideoPlayer
.
mFullPauseBitmap
=
mFullPauseBitmap
;
gsyVideoPlayer
.
setUp
(
mUrl
,
mCache
,
mCachePath
,
mMapHeadData
,
mObjects
);
gsyVideoPlayer
.
setStateAndUi
(
mCurrentState
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录