Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
沁852
GSYVideoPlayer
提交
40afa17c
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(gitcode.net)2024年7月9日维护升级公告
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
40afa17c
编写于
12月 01, 2016
作者:
S
shuyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.3.7 优化了暂停的时候全屏/恢复全屏会是黑色的问题
上级
18d2a091
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
2 deletion
+33
-2
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/utils/CommonUtil.java
.../main/java/com/shuyu/gsyvideoplayer/utils/CommonUtil.java
+28
-0
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/GSYBaseVideoPlayer.java
...va/com/shuyu/gsyvideoplayer/video/GSYBaseVideoPlayer.java
+5
-2
未找到文件。
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/utils/CommonUtil.java
浏览文件 @
40afa17c
...
...
@@ -3,6 +3,7 @@ package com.shuyu.gsyvideoplayer.utils;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.ContextWrapper
;
import
android.graphics.Point
;
import
android.net.ConnectivityManager
;
import
android.net.NetworkInfo
;
import
android.os.Build
;
...
...
@@ -15,6 +16,8 @@ import android.util.TypedValue;
import
android.view.View
;
import
android.view.WindowManager
;
import
com.shuyu.gsyvideoplayer.GSYVideoManager
;
import
java.io.File
;
import
java.util.Formatter
;
import
java.util.Locale
;
...
...
@@ -262,4 +265,29 @@ public class CommonUtil {
}
}
public
static
Point
getPauseBitmapSize
(
int
w
,
int
h
)
{
int
videoHeight
=
0
;
int
videoWidth
=
0
;
if
(
GSYVideoManager
.
instance
().
getMediaPlayer
()
!=
null
)
{
videoHeight
=
GSYVideoManager
.
instance
().
getCurrentVideoHeight
();
videoWidth
=
GSYVideoManager
.
instance
().
getCurrentVideoWidth
();
}
if
(
videoHeight
==
0
||
videoWidth
==
0
)
{
videoWidth
=
w
;
videoHeight
=
h
;
}
if
(
videoWidth
>
w
||
videoHeight
>
h
)
{
videoWidth
=
w
;
videoHeight
=
h
;
}
return
new
Point
(
videoWidth
,
videoHeight
);
}
}
gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/GSYBaseVideoPlayer.java
浏览文件 @
40afa17c
...
...
@@ -11,6 +11,7 @@ import android.view.Gravity;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.widget.FrameLayout
;
import
android.widget.ImageView
;
...
...
@@ -383,7 +384,8 @@ public abstract class GSYBaseVideoPlayer extends FrameLayout implements GSYMedia
private
void
pauseFullCoverLogic
()
{
if
(
mCurrentState
==
GSYVideoPlayer
.
CURRENT_STATE_PAUSE
&&
mTextureView
!=
null
&&
(
mFullPauseBitmap
==
null
||
mFullPauseBitmap
.
isRecycled
()))
{
mFullPauseBitmap
=
mTextureView
.
getBitmap
();
Point
point
=
CommonUtil
.
getPauseBitmapSize
(
getWidth
(),
getHeight
());
mFullPauseBitmap
=
mTextureView
.
getBitmap
(
point
.
x
,
point
.
y
);
}
}
...
...
@@ -399,8 +401,9 @@ public abstract class GSYBaseVideoPlayer extends FrameLayout implements GSYMedia
&&
!
gsyVideoPlayer
.
mFullPauseBitmap
.
isRecycled
())
{
mFullPauseBitmap
=
gsyVideoPlayer
.
mFullPauseBitmap
;
}
else
{
Point
point
=
CommonUtil
.
getPauseBitmapSize
(
getWidth
(),
getHeight
());
//不在了说明已经播放过,还是暂停的话,我们拿回来就好
mFullPauseBitmap
=
gsyVideoPlayer
.
mTextureView
.
getBitmap
();
mFullPauseBitmap
=
gsyVideoPlayer
.
mTextureView
.
getBitmap
(
point
.
x
,
point
.
y
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录