Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
沁852
GSYVideoPlayer
提交
42667f43
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 搜索 >>
提交
42667f43
编写于
12月 07, 2016
作者:
S
shuyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.4.3
上级
3649bc1b
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
16 addition
and
18 deletion
+16
-18
README.md
README.md
+5
-5
app/src/main/java/com/example/gsyvideoplayer/GSYApplication.java
.../main/java/com/example/gsyvideoplayer/GSYApplication.java
+1
-3
app/src/main/java/com/example/gsyvideoplayer/video/SampleVideo.java
...in/java/com/example/gsyvideoplayer/video/SampleVideo.java
+4
-4
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/GSYTextureView.java
...rc/main/java/com/shuyu/gsyvideoplayer/GSYTextureView.java
+3
-3
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoManager.java
...c/main/java/com/shuyu/gsyvideoplayer/GSYVideoManager.java
+2
-2
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/utils/GSYVideoType.java
...ain/java/com/shuyu/gsyvideoplayer/utils/GSYVideoType.java
+1
-1
未找到文件。
README.md
浏览文件 @
42667f43
...
...
@@ -41,7 +41,7 @@ dependencies {
## [*********** *问题集锦入口* ***********](https://github.com/CarGuo/GSYVideoPlayer/blob/master/QUESTION.md)
## [
*********** *IJKPlayer问题入口* ***********
](http://www.jianshu.com/p/220b00d00deb)
## [
IJKPlayer问题入口
](http://www.jianshu.com/p/220b00d00deb)
## 效果,录屏下的屏幕旋转和实际有些出入
...
...
@@ -64,11 +64,11 @@ dependencies {
### 1.4.3
*
增加了设置显示比例
Common
Type。
*
DEMO增加SampleVideo,在PlayActivity使用,
可调节显示比例
。
*
增加了开启和关闭硬解码的接口
Common
Type。
*
增加了设置显示比例
GSYVideo
Type。
*
DEMO增加SampleVideo,在PlayActivity使用,
调节显示比例效果
。
*
增加了开启和关闭硬解码的接口
GSYVideo
Type。
Common
Type
GSYVideo
Type
```
/**
* 设置显示比例
...
...
app/src/main/java/com/example/gsyvideoplayer/GSYApplication.java
浏览文件 @
42667f43
...
...
@@ -2,8 +2,6 @@ package com.example.gsyvideoplayer;
import
android.app.Application
;
import
com.shuyu.gsyvideoplayer.utils.CommonType
;
//import com.squareup.leakcanary.LeakCanary;
/**
...
...
@@ -21,6 +19,6 @@ public class GSYApplication extends Application {
//return;
//}
//LeakCanary.install(this);
//
Common
Type.enableMediaCodec();
//
GSYVideo
Type.enableMediaCodec();
}
}
app/src/main/java/com/example/gsyvideoplayer/video/SampleVideo.java
浏览文件 @
42667f43
...
...
@@ -6,7 +6,7 @@ import android.view.View;
import
android.widget.TextView
;
import
com.example.gsyvideoplayer.R
;
import
com.shuyu.gsyvideoplayer.utils.
Common
Type
;
import
com.shuyu.gsyvideoplayer.utils.
GSYVideo
Type
;
import
com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
;
/**
...
...
@@ -37,19 +37,19 @@ public class SampleVideo extends StandardGSYVideoPlayer {
if
(
type
==
0
)
{
type
=
1
;
mMoreScale
.
setText
(
"16:9"
);
CommonType
.
setShowType
(
Common
Type
.
SCREEN_TYPE_16_9
);
GSYVideoType
.
setShowType
(
GSYVideo
Type
.
SCREEN_TYPE_16_9
);
if
(
mTextureView
!=
null
)
mTextureView
.
requestLayout
();
}
else
if
(
type
==
1
)
{
type
=
2
;
mMoreScale
.
setText
(
"4:3"
);
CommonType
.
setShowType
(
Common
Type
.
SCREEN_TYPE_4_3
);
GSYVideoType
.
setShowType
(
GSYVideo
Type
.
SCREEN_TYPE_4_3
);
if
(
mTextureView
!=
null
)
mTextureView
.
requestLayout
();
}
else
if
(
type
==
2
)
{
type
=
0
;
mMoreScale
.
setText
(
"默认比例"
);
CommonType
.
setShowType
(
Common
Type
.
SCREEN_TYPE_DEFAULT
);
GSYVideoType
.
setShowType
(
GSYVideo
Type
.
SCREEN_TYPE_DEFAULT
);
if
(
mTextureView
!=
null
)
mTextureView
.
requestLayout
();
}
...
...
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/GSYTextureView.java
浏览文件 @
42667f43
...
...
@@ -4,7 +4,7 @@ import android.content.Context;
import
android.util.AttributeSet
;
import
android.view.TextureView
;
import
com.shuyu.gsyvideoplayer.utils.
Common
Type
;
import
com.shuyu.gsyvideoplayer.utils.
GSYVideo
Type
;
/**
* 用于显示video的,做了横屏与竖屏的匹配,还有需要rotation需求的
...
...
@@ -103,13 +103,13 @@ public class GSYTextureView extends TextureView {
}
//如果设置了比例
if
(
CommonType
.
getShowType
()
==
Common
Type
.
SCREEN_TYPE_16_9
)
{
if
(
GSYVideoType
.
getShowType
()
==
GSYVideo
Type
.
SCREEN_TYPE_16_9
)
{
if
(
height
>
width
)
{
width
=
height
*
9
/
16
;
}
else
{
height
=
width
*
9
/
16
;
}
}
else
if
(
CommonType
.
getShowType
()
==
Common
Type
.
SCREEN_TYPE_4_3
)
{
}
else
if
(
GSYVideoType
.
getShowType
()
==
GSYVideo
Type
.
SCREEN_TYPE_4_3
)
{
if
(
height
>
width
)
{
width
=
height
*
3
/
4
;
}
else
{
...
...
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoManager.java
浏览文件 @
42667f43
...
...
@@ -14,7 +14,7 @@ import com.danikula.videocache.HttpProxyCacheServer;
import
com.danikula.videocache.file.Md5FileNameGenerator
;
import
com.shuyu.gsyvideoplayer.listener.GSYMediaPlayerListener
;
import
com.shuyu.gsyvideoplayer.model.GSYModel
;
import
com.shuyu.gsyvideoplayer.utils.
Common
Type
;
import
com.shuyu.gsyvideoplayer.utils.
GSYVideo
Type
;
import
com.shuyu.gsyvideoplayer.utils.CommonUtil
;
import
com.shuyu.gsyvideoplayer.utils.Debuger
;
import
com.shuyu.gsyvideoplayer.utils.FileUtils
;
...
...
@@ -233,7 +233,7 @@ public class GSYVideoManager implements IMediaPlayer.OnPreparedListener, IMediaP
currentVideoHeight
=
0
;
mediaPlayer
.
release
();
mediaPlayer
=
new
IjkMediaPlayer
();
if
(
Common
Type
.
isMediaCodec
())
{
if
(
GSYVideo
Type
.
isMediaCodec
())
{
Debuger
.
printfLog
(
"enable mediaCodec"
);
mediaPlayer
.
setOption
(
IjkMediaPlayer
.
OPT_CATEGORY_PLAYER
,
"mediacodec"
,
1
);
mediaPlayer
.
setOption
(
IjkMediaPlayer
.
OPT_CATEGORY_PLAYER
,
"mediacodec-auto-rotate"
,
1
);
...
...
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/utils/
Common
Type.java
→
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/utils/
GSYVideo
Type.java
浏览文件 @
42667f43
...
...
@@ -4,7 +4,7 @@ package com.shuyu.gsyvideoplayer.utils;
* Created by shuyu on 2016/12/7.
*/
public
class
Common
Type
{
public
class
GSYVideo
Type
{
//默认显示比例
public
final
static
int
SCREEN_TYPE_DEFAULT
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录