Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ac13
GSYVideoPlayer
提交
e14f0cbc
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 搜索 >>
提交
e14f0cbc
编写于
2月 28, 2020
作者:
G
guoshuyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
a6291378
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
1 deletion
+31
-1
app/src/main/java/com/example/gsyvideoplayer/MainActivity.java
...rc/main/java/com/example/gsyvideoplayer/MainActivity.java
+25
-1
app/src/main/res/layout/activity_main.xml
app/src/main/res/layout/activity_main.xml
+6
-0
未找到文件。
app/src/main/java/com/example/gsyvideoplayer/MainActivity.java
浏览文件 @
e14f0cbc
...
...
@@ -15,12 +15,16 @@ import android.widget.Toast;
import
com.example.gsyvideoplayer.simple.SimpleActivity
;
import
com.example.gsyvideoplayer.utils.JumpUtils
;
import
com.shuyu.gsyvideoplayer.GSYVideoManager
;
import
com.shuyu.gsyvideoplayer.player.IjkPlayerManager
;
import
com.shuyu.gsyvideoplayer.player.PlayerFactory
;
import
com.shuyu.gsyvideoplayer.player.SystemPlayerManager
;
import
com.shuyu.gsyvideoplayer.utils.Debuger
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.OnClick
;
import
permissions.dispatcher.PermissionUtils
;
import
tv.danmaku.ijk.media.exo2.Exo2PlayerManager
;
public
class
MainActivity
extends
AppCompatActivity
{
...
...
@@ -30,8 +34,14 @@ public class MainActivity extends AppCompatActivity {
@BindView
(
R
.
id
.
open_btn_empty
)
Button
openBtn2
;
@BindView
(
R
.
id
.
change_core
)
Button
changeCore
;
final
String
[]
permissions
=
{
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
};
int
i
=
0
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
...
...
@@ -56,7 +66,8 @@ public class MainActivity extends AppCompatActivity {
@OnClick
({
R
.
id
.
open_btn
,
R
.
id
.
list_btn
,
R
.
id
.
list_btn_2
,
R
.
id
.
list_detail
,
R
.
id
.
clear_cache
,
R
.
id
.
recycler
,
R
.
id
.
recycler_2
,
R
.
id
.
list_detail_list
,
R
.
id
.
web_detail
,
R
.
id
.
danmaku_video
,
R
.
id
.
fragment_video
,
R
.
id
.
more_type
,
R
.
id
.
input_type
,
R
.
id
.
open_btn_empty
,
R
.
id
.
open_control
,
R
.
id
.
open_filter
,
R
.
id
.
open_btn_pick
,
R
.
id
.
open_btn_auto
,
R
.
id
.
open_scroll
,
R
.
id
.
open_window
,
R
.
id
.
open_btn_ad
,
R
.
id
.
open_btn_multi
,
R
.
id
.
open_btn_ad2
,
R
.
id
.
open_list_ad
,
R
.
id
.
open_custom_exo
,
R
.
id
.
open_simple
,
R
.
id
.
open_switch
,
R
.
id
.
media_codec
,
R
.
id
.
detail_normal_activity
,
R
.
id
.
detail_download_activity
,
R
.
id
.
detail_audio_activity
,
R
.
id
.
detail_subtitle_activity
})
R
.
id
.
open_btn_multi
,
R
.
id
.
open_btn_ad2
,
R
.
id
.
open_list_ad
,
R
.
id
.
open_custom_exo
,
R
.
id
.
open_simple
,
R
.
id
.
open_switch
,
R
.
id
.
media_codec
,
R
.
id
.
detail_normal_activity
,
R
.
id
.
detail_download_activity
,
R
.
id
.
detail_audio_activity
,
R
.
id
.
detail_subtitle_activity
,
R
.
id
.
change_core
})
public
void
onClick
(
View
view
)
{
switch
(
view
.
getId
())
{
case
R
.
id
.
open_simple
:
...
...
@@ -173,6 +184,19 @@ public class MainActivity extends AppCompatActivity {
case
R
.
id
.
detail_audio_activity
:
JumpUtils
.
goToDetailAudioActivity
(
this
);
break
;
case
R
.
id
.
change_core
:
i
+=
1
;
if
(
i
%
3
==
0
)
{
PlayerFactory
.
setPlayManager
(
IjkPlayerManager
.
class
);
changeCore
.
setText
(
"IJK 内核"
);
}
else
if
(
i
%
3
==
1
)
{
PlayerFactory
.
setPlayManager
(
Exo2PlayerManager
.
class
);
changeCore
.
setText
(
"EXO 内核"
);
}
else
if
(
i
%
3
==
2
)
{
PlayerFactory
.
setPlayManager
(
SystemPlayerManager
.
class
);
changeCore
.
setText
(
"系统 内核"
);
}
break
;
case
R
.
id
.
clear_cache
:
//清理缓存
GSYVideoManager
.
instance
().
clearAllDefaultCache
(
MainActivity
.
this
);
...
...
app/src/main/res/layout/activity_main.xml
浏览文件 @
e14f0cbc
...
...
@@ -232,6 +232,12 @@
android:layout_height=
"wrap_content"
android:layout_marginTop=
"20dp"
android:text=
"音频"
/>
<Button
android:id=
"@+id/change_core"
android:layout_width=
"240dp"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"20dp"
android:text=
"Ijk 内核"
/>
<Button
android:id=
"@+id/clear_cache"
android:layout_width=
"240dp"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录