Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
NotesChapter
GSYVideoPlayer
提交
6726d10f
G
GSYVideoPlayer
项目概览
NotesChapter
/
GSYVideoPlayer
与 Fork 源项目一致
从无法访问的项目Fork
通知
8
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,发现更多精彩内容 >>
提交
6726d10f
编写于
5月 16, 2018
作者:
G
guoshuyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化Exo在切换surface时候的问题
上级
817554d9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
8 deletion
+14
-8
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoBaseManager.java
...in/java/com/shuyu/gsyvideoplayer/GSYVideoBaseManager.java
+2
-2
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/player/EXO2PlayerManager.java
...va/com/shuyu/gsyvideoplayer/player/EXO2PlayerManager.java
+12
-6
未找到文件。
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoBaseManager.java
浏览文件 @
6726d10f
...
...
@@ -271,7 +271,8 @@ public abstract class GSYVideoBaseManager implements IMediaPlayer.OnPreparedList
Message
msg
=
new
Message
();
msg
.
what
=
HANDLER_SETDISPLAY
;
msg
.
obj
=
holder
;
mMediaHandler
.
sendMessage
(
msg
);
showDisplay
(
msg
);
Debuger
.
printfError
(
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
);
}
@Override
...
...
@@ -469,7 +470,6 @@ public abstract class GSYVideoBaseManager implements IMediaPlayer.OnPreparedList
initVideo
(
msg
);
break
;
case
HANDLER_SETDISPLAY:
showDisplay
(
msg
);
break
;
case
HANDLER_RELEASE:
if
(
playerManager
!=
null
)
{
...
...
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/player/EXO2PlayerManager.java
浏览文件 @
6726d10f
...
...
@@ -6,9 +6,9 @@ import android.net.Uri;
import
android.os.Message
;
import
android.view.Surface
;
import
com.google.android.exoplayer2.video.DummySurface
;
import
com.shuyu.gsyvideoplayer.model.GSYModel
;
import
com.shuyu.gsyvideoplayer.model.VideoOptionModel
;
import
com.shuyu.gsyvideoplayer.utils.Debuger
;
import
java.util.List
;
...
...
@@ -26,6 +26,8 @@ public class EXO2PlayerManager implements IPlayerManager {
private
Surface
surface
;
private
DummySurface
dummySurface
;
@Override
public
IMediaPlayer
getMediaPlayer
()
{
return
mediaPlayer
;
...
...
@@ -36,6 +38,9 @@ public class EXO2PlayerManager implements IPlayerManager {
//目前EXO2在频繁的切换Surface时会可能出现 (queueBuffer: BufferQueue has been abandoned)
mediaPlayer
=
new
IjkExo2MediaPlayer
(
context
);
mediaPlayer
.
setAudioStreamType
(
AudioManager
.
STREAM_MUSIC
);
if
(
dummySurface
==
null
)
{
dummySurface
=
DummySurface
.
newInstanceV17
(
context
,
false
);
}
try
{
mediaPlayer
.
setDataSource
(
context
,
Uri
.
parse
(((
GSYModel
)
msg
.
obj
).
getUrl
()),
((
GSYModel
)
msg
.
obj
).
getMapHeadData
());
//很遗憾,EXO2的setSpeed只能在播放前生效
...
...
@@ -53,11 +58,7 @@ public class EXO2PlayerManager implements IPlayerManager {
return
;
}
if
(
msg
.
obj
==
null
)
{
mediaPlayer
.
setSurface
(
null
);
if
(
surface
!=
null
)
{
surface
.
release
();
surface
=
null
;
}
mediaPlayer
.
setSurface
(
dummySurface
);
}
else
{
Surface
holder
=
(
Surface
)
msg
.
obj
;
surface
=
holder
;
...
...
@@ -96,7 +97,12 @@ public class EXO2PlayerManager implements IPlayerManager {
@Override
public
void
release
()
{
if
(
mediaPlayer
!=
null
)
{
mediaPlayer
.
setSurface
(
null
);
mediaPlayer
.
release
();
}
if
(
dummySurface
!=
null
)
{
dummySurface
.
release
();
dummySurface
=
null
;
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录