Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ac13
GSYVideoPlayer
提交
8afa5198
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 搜索 >>
提交
8afa5198
编写于
7月 23, 2018
作者:
L
liweijie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改对于Audio冲突时候的处理,子类可以复写方法自己自行另外处理
上级
80f25e03
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
47 addition
and
17 deletion
+47
-17
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/base/GSYVideoView.java
...ava/com/shuyu/gsyvideoplayer/video/base/GSYVideoView.java
+47
-17
未找到文件。
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/base/GSYVideoView.java
浏览文件 @
8afa5198
...
...
@@ -337,31 +337,60 @@ public abstract class GSYVideoView extends GSYTextureRenderView implements GSYMe
public
void
onAudioFocusChange
(
int
focusChange
)
{
switch
(
focusChange
)
{
case
AudioManager
.
AUDIOFOCUS_GAIN
:
onGankAudio
();
break
;
case
AudioManager
.
AUDIOFOCUS_LOSS
:
post
(
new
Runnable
()
{
@Override
onLossAudio
();
break
;
case
AudioManager
.
AUDIOFOCUS_LOSS_TRANSIENT
:
onLossTransientAudio
();
break
;
case
AudioManager
.
AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK
:
onLossTransientCanDuck
();
break
;
}
}
};
/**
* 获得了Audio Focus
*/
protected
void
onGankAudio
()
{
}
/**
* 失去了Audio Focus,并将会持续很长的时间
*/
protected
void
onLossAudio
()
{
this
.
post
(
new
Runnable
()
{
public
void
run
()
{
if
(
mReleaseWhenLossAudio
)
{
releaseVideos
();
if
(
GSYVideoView
.
this
.
mReleaseWhenLossAudio
)
{
GSYVideoView
.
this
.
releaseVideos
();
}
else
{
onVideoPause
();
GSYVideoView
.
this
.
onVideoPause
();
}
}
});
break
;
case
AudioManager
.
AUDIOFOCUS_LOSS_TRANSIENT
:
}
/**
* 暂时失去Audio Focus,并会很快再次获得
*/
protected
void
onLossTransientAudio
()
{
try
{
onVideoPause
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
this
.
onVideoPause
();
}
catch
(
Exception
var2
)
{
var2
.
printStackTrace
();
}
break
;
case
AudioManager
.
AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK
:
break
;
}
/**
* 暂时失去AudioFocus,但是可以继续播放,不过要在降低音量
*/
protected
void
onLossTransientCanDuck
()
{
}
};
/**
...
...
@@ -1013,7 +1042,7 @@ public abstract class GSYVideoView extends GSYTextureRenderView implements GSYMe
*/
public
void
setSpeedPlaying
(
float
speed
,
boolean
soundTouch
)
{
setSpeed
(
speed
,
soundTouch
);
getGSYVideoManager
().
setSpeedPlaying
(
speed
,
soundTouch
);
getGSYVideoManager
().
setSpeedPlaying
(
speed
,
soundTouch
);
}
public
boolean
isShowPauseCover
()
{
...
...
@@ -1036,7 +1065,7 @@ public abstract class GSYVideoView extends GSYTextureRenderView implements GSYMe
*/
public
void
seekTo
(
long
position
)
{
try
{
if
(
getGSYVideoManager
()!=
null
&&
position
>
0
)
{
if
(
getGSYVideoManager
()
!=
null
&&
position
>
0
)
{
getGSYVideoManager
().
seekTo
(
position
);
}
}
catch
(
Exception
e
)
{
...
...
@@ -1076,6 +1105,7 @@ public abstract class GSYVideoView extends GSYTextureRenderView implements GSYMe
/**
* 单独设置mapHeader
*
* @param headData
*/
public
void
setMapHeadData
(
Map
<
String
,
String
>
headData
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录