Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
沁852
GSYVideoPlayer
提交
f09e51c0
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 搜索 >>
提交
f09e51c0
编写于
11月 28, 2016
作者:
S
shuyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.2.9
上级
71811897
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
69 addition
and
9 deletion
+69
-9
README.md
README.md
+22
-2
gradle.properties
gradle.properties
+1
-1
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java
...rc/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java
+23
-0
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/utils/CommonUtil.java
.../main/java/com/shuyu/gsyvideoplayer/utils/CommonUtil.java
+23
-6
未找到文件。
README.md
浏览文件 @
f09e51c0
...
...
@@ -17,13 +17,13 @@
<dependency>
<groupId>com.shuyu</groupId>
<artifactId>gsyVideoPlayer</artifactId>
<version>1.2.
8
</version>
<version>1.2.
9
</version>
<type>pom</type>
</dependency>
```
```
compile 'com.shuyu:gsyVideoPlayer:1.2.
8
'
compile 'com.shuyu:gsyVideoPlayer:1.2.
9
'
```
## 效果,录屏下的屏幕旋转和实际有些出入
...
...
@@ -43,6 +43,26 @@ compile 'com.shuyu:gsyVideoPlayer:1.2.8'
*
<h4>
3、详情模式
</h4>
<img
src=
"https://github.com/CarGuo/GSYVideoPlayer/blob/master/04.gif"
width=
"240px"
height=
"426px"
/>
### 1.2.9 增加了下载速度的接口
```
/**
* 网络速度
* 注意,这里如果是开启了缓存,因为读取本地代理,缓存成功后还是存在速度的
* 再打开已经缓存的本地文件,网络速度才会回0.因为是播放本地文件了
*/
public long getNetSpeed()
/**
* 网络速度
* 注意,这里如果是开启了缓存,因为读取本地代理,缓存成功后还是存在速度的
* 再打开已经缓存的本地文件,网络速度才会回0.因为是播放本地文件了
*/
public String getNetSpeedText()
```
### 1.2.8 升级IJKPlayer到0.7.5;增加了改变播放速度(0-2左右的速度),但只支持6.0以上。
```
/**
...
...
gradle.properties
浏览文件 @
f09e51c0
...
...
@@ -18,7 +18,7 @@ org.gradle.jvmargs=-Xmx1536m
BINTRAY_USER
=
BINTRAY_KEY
=
PROJ_GROUP
=
com.shuyu
PROJ_VERSION
=
1.2.
8
PROJ_VERSION
=
1.2.
9
PROJ_NAME
=
gsyVideo
PROJ_WEBSITEURL
=
hhttps://github.com/CarGuo/GSYVideoPlayer
PROJ_ISSUETRACKERURL
=
...
...
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java
浏览文件 @
f09e51c0
...
...
@@ -34,6 +34,8 @@ import java.util.TimerTask;
import
tv.danmaku.ijk.media.player.IMediaPlayer
;
import
static
com
.
shuyu
.
gsyvideoplayer
.
utils
.
CommonUtil
.
getTextSpeed
;
/**
* Created by shuyu on 2016/11/11.
...
...
@@ -103,6 +105,7 @@ public abstract class GSYVideoPlayer extends GSYBaseVideoPlayer implements View.
protected
int
mSeekToInAdvance
=
-
1
;
//// TODO: 2016/11/13 跳过广告
protected
int
mRotate
=
0
;
//针对某些视频的旋转信息做了旋转处理
protected
int
mSeekTimePosition
;
//手动改变滑动的位置
...
...
@@ -732,6 +735,7 @@ public abstract class GSYVideoPlayer extends GSYBaseVideoPlayer implements View.
if
(
mLooping
&&
percent
==
0
&&
mProgressBar
.
getProgress
()
>
3
)
{
loopSetProgressAndTime
();
}
Debuger
.
printfLog
(
"Net speed: "
+
getNetSpeedText
());
}
}
...
...
@@ -1043,5 +1047,24 @@ public abstract class GSYVideoPlayer extends GSYBaseVideoPlayer implements View.
return
backFrom
;
}
/**
* 网络速度
* 注意,这里如果是开启了缓存,因为读取本地代理,缓存成功后还是存在速度的
* 再打开已经缓存的本地文件,网络速度才会回0.因为是播放本地文件了
*/
public
long
getNetSpeed
()
{
return
GSYVideoManager
.
instance
().
getMediaPlayer
().
getTcpSpeed
();
}
/**
* 网络速度
* 注意,这里如果是开启了缓存,因为读取本地代理,缓存成功后还是存在速度的
* 再打开已经缓存的本地文件,网络速度才会回0.因为是播放本地文件了
*/
public
String
getNetSpeedText
()
{
long
speed
=
GSYVideoManager
.
instance
().
getMediaPlayer
().
getTcpSpeed
();
return
getTextSpeed
(
speed
);
}
}
\ No newline at end of file
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/utils/CommonUtil.java
浏览文件 @
f09e51c0
...
...
@@ -101,8 +101,9 @@ public class CommonUtil {
public
static
void
hideSupportActionBar
(
Context
context
,
boolean
actionBar
,
boolean
statusBar
)
{
if
(
actionBar
)
{
if
(
context
instanceof
FragmentActivity
)
{
FragmentActivity
fragmentActivity
=
(
FragmentActivity
)
context
;
android
.
app
.
ActionBar
ab
=
fragmentActivity
.
getActionBar
();
if
(
ab
!=
null
)
{
FragmentActivity
fragmentActivity
=
(
FragmentActivity
)
context
;
android
.
app
.
ActionBar
ab
=
fragmentActivity
.
getActionBar
();
if
(
ab
!=
null
)
{
ab
.
hide
();
}
}
else
{
...
...
@@ -115,7 +116,7 @@ public class CommonUtil {
}
if
(
statusBar
)
{
if
(
context
instanceof
FragmentActivity
)
{
FragmentActivity
fragmentActivity
=
(
FragmentActivity
)
context
;
FragmentActivity
fragmentActivity
=
(
FragmentActivity
)
context
;
fragmentActivity
.
getWindow
().
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
,
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
);
}
else
{
...
...
@@ -128,8 +129,9 @@ public class CommonUtil {
public
static
void
showSupportActionBar
(
Context
context
,
boolean
actionBar
,
boolean
statusBar
)
{
if
(
actionBar
)
{
if
(
context
instanceof
FragmentActivity
)
{
FragmentActivity
fragmentActivity
=
(
FragmentActivity
)
context
;
android
.
app
.
ActionBar
ab
=
fragmentActivity
.
getActionBar
();
if
(
ab
!=
null
)
{
FragmentActivity
fragmentActivity
=
(
FragmentActivity
)
context
;
android
.
app
.
ActionBar
ab
=
fragmentActivity
.
getActionBar
();
if
(
ab
!=
null
)
{
ab
.
show
();
}
}
else
{
...
...
@@ -143,7 +145,7 @@ public class CommonUtil {
if
(
statusBar
)
{
if
(
context
instanceof
FragmentActivity
)
{
FragmentActivity
fragmentActivity
=
(
FragmentActivity
)
context
;
FragmentActivity
fragmentActivity
=
(
FragmentActivity
)
context
;
fragmentActivity
.
getWindow
().
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
);
}
else
{
CommonUtil
.
getAppCompActivity
(
context
).
getWindow
().
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
);
...
...
@@ -211,6 +213,21 @@ public class CommonUtil {
return
outMetrics
.
heightPixels
;
}
/**
* 下载速度文本
*/
public
static
String
getTextSpeed
(
long
speed
)
{
String
text
=
""
;
if
(
speed
>=
0
&&
speed
<
1024
)
{
text
=
speed
+
" KB/s"
;
}
else
if
(
speed
>=
1024
&&
speed
<
(
1024
*
1024
))
{
text
=
Long
.
toString
(
speed
/
1024
)
+
" KB/s"
;
}
else
if
(
speed
>=
(
1024
*
1024
)
&&
speed
<
(
1024
*
1024
*
1024
))
{
text
=
Long
.
toString
(
speed
/
(
1024
*
1024
))
+
" MB/s"
;
}
return
text
;
}
public
static
void
deleteFile
(
String
filePath
)
{
File
file
=
new
File
(
filePath
);
if
(
file
.
exists
())
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录