Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ac13
GSYVideoPlayer
提交
9979ab7a
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 搜索 >>
提交
9979ab7a
编写于
2月 05, 2018
作者:
G
guoshuyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix ad demo
上级
85e4a722
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
31 addition
and
9 deletion
+31
-9
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/GSYBaseADActivityDetail.java
...ava/com/shuyu/gsyvideoplayer/GSYBaseADActivityDetail.java
+9
-6
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/GSYADVideoPlayer.java
...java/com/shuyu/gsyvideoplayer/video/GSYADVideoPlayer.java
+14
-3
gsyVideoPlayer-java/src/main/res/layout/video_layout_ad.xml
gsyVideoPlayer-java/src/main/res/layout/video_layout_ad.xml
+8
-0
未找到文件。
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/GSYBaseADActivityDetail.java
浏览文件 @
9979ab7a
...
...
@@ -15,6 +15,7 @@ import com.shuyu.gsyvideoplayer.video.GSYADVideoPlayer;
import
com.shuyu.gsyvideoplayer.video.NormalGSYVideoPlayer
;
import
com.shuyu.gsyvideoplayer.video.base.GSYBaseVideoPlayer
;
import
com.shuyu.gsyvideoplayer.video.base.GSYVideoPlayer
;
import
com.shuyu.gsyvideoplayer.video.base.GSYVideoView
;
/**
* 详情AD模式播放页面基础类
...
...
@@ -24,8 +25,6 @@ public abstract class GSYBaseADActivityDetail<T extends GSYBaseVideoPlayer, R ex
protected
OrientationUtils
mADOrientationUtils
;
protected
boolean
isAdPlayed
;
@Override
public
void
initVideo
()
{
super
.
initVideo
();
...
...
@@ -57,7 +56,6 @@ public abstract class GSYBaseADActivityDetail<T extends GSYBaseVideoPlayer, R ex
@Override
public
void
onStartPrepared
(
String
url
,
Object
...
objects
)
{
super
.
onStartPrepared
(
url
,
objects
);
isAdPlayed
=
true
;
//开始播放了才能旋转和全屏
mADOrientationUtils
.
setEnable
(
getDetailOrientationRotateAuto
());
}
...
...
@@ -68,7 +66,6 @@ public abstract class GSYBaseADActivityDetail<T extends GSYBaseVideoPlayer, R ex
getGSYADVideoPlayer
().
release
();
getGSYADVideoPlayer
().
onVideoReset
();
getGSYADVideoPlayer
().
setVisibility
(
View
.
GONE
);
isAdPlayed
=
false
;
//开始播放原视频,根据是否处于全屏状态判断
getGSYVideoPlayer
().
getCurrentPlayer
().
startAfterPrepared
();
if
(
getGSYADVideoPlayer
().
getCurrentPlayer
().
isIfCurrentIsFullscreen
())
{
...
...
@@ -142,8 +139,8 @@ public abstract class GSYBaseADActivityDetail<T extends GSYBaseVideoPlayer, R ex
public
void
onConfigurationChanged
(
Configuration
newConfig
)
{
//如果旋转了就全屏
boolean
backUpIsPlay
=
isPlay
;
if
(
isAdPlayed
&&
!
isPause
&&
getGSYADVideoPlayer
().
getVisibility
()
==
View
.
VISIBLE
)
{
if
(
getGSYADVideoPlayer
().
getCurrentPlayer
().
isInPlayingState
())
{
if
(!
isPause
&&
getGSYADVideoPlayer
().
getVisibility
()
==
View
.
VISIBLE
)
{
if
(
isADStarted
())
{
isPlay
=
false
;
getGSYADVideoPlayer
().
getCurrentPlayer
().
onConfigurationChanged
(
this
,
newConfig
,
mADOrientationUtils
);
}
...
...
@@ -178,6 +175,12 @@ public abstract class GSYBaseADActivityDetail<T extends GSYBaseVideoPlayer, R ex
}
protected
boolean
isADStarted
()
{
return
getGSYADVideoPlayer
().
getCurrentPlayer
().
getCurrentState
()
>=
0
&&
getGSYADVideoPlayer
().
getCurrentPlayer
().
getCurrentState
()
!=
GSYVideoView
.
CURRENT_STATE_NORMAL
&&
getGSYADVideoPlayer
().
getCurrentPlayer
().
getCurrentState
()
!=
GSYVideoView
.
CURRENT_STATE_AUTO_COMPLETE
;
}
/**
* 显示播放广告
*/
...
...
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/GSYADVideoPlayer.java
浏览文件 @
9979ab7a
...
...
@@ -110,17 +110,28 @@ public class GSYADVideoPlayer extends StandardGSYVideoPlayer {
changeAdUIState
();
}
@Override
public
void
onClick
(
View
v
)
{
if
(
v
.
getId
()
==
R
.
id
.
start
)
{
if
(
mCurrentState
==
CURRENT_STATE_ERROR
)
{
clickStartIcon
();
}
}
else
{
super
.
onClick
(
v
);
}
}
@Override
protected
void
updateStartImage
()
{
if
(
mStartButton
!=
null
)
{
if
(
mStartButton
instanceof
ImageView
)
{
ImageView
imageView
=
(
ImageView
)
mStartButton
;
if
(
mCurrentState
==
CURRENT_STATE_PLAYING
)
{
imageView
.
setImageResource
(
R
.
drawable
.
video_click_pause_selector
);
imageView
.
setImageResource
(
R
.
drawable
.
empty_drawable
);
}
else
if
(
mCurrentState
==
CURRENT_STATE_ERROR
)
{
imageView
.
setImageResource
(
R
.
drawable
.
video_click_
play
_selector
);
imageView
.
setImageResource
(
R
.
drawable
.
video_click_
error
_selector
);
}
else
{
imageView
.
setImageResource
(
R
.
drawable
.
video_click_play_selector
);
imageView
.
setImageResource
(
R
.
drawable
.
empty_drawable
);
}
}
}
...
...
gsyVideoPlayer-java/src/main/res/layout/video_layout_ad.xml
浏览文件 @
9979ab7a
...
...
@@ -49,6 +49,14 @@
android:layout_centerVertical=
"true"
android:visibility=
"invisible"
/>
<ImageView
android:id=
"@+id/start"
android:layout_width=
"60dp"
android:layout_height=
"60dp"
android:layout_centerHorizontal=
"true"
android:layout_centerVertical=
"true"
android:layout_gravity=
"center_vertical"
/>
<TextView
android:id=
"@+id/jump_ad"
android:layout_width=
"wrap_content"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录