Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
Z
zxhc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王雪伟
zxhc
Commits
68d366e7
Commit
68d366e7
authored
Jul 15, 2021
by
zxhljwl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
35868e00
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
10 deletions
+19
-10
RewardVideoMediaPlayer.java
.../main/java/com/ym/zxhcsdk/ads/RewardVideoMediaPlayer.java
+4
-0
RewardVideoPortraitADActivity.java
...ava/com/ym/zxhcsdk/ads/RewardVideoPortraitADActivity.java
+15
-10
No files found.
zxhcsdk/src/main/java/com/ym/zxhcsdk/ads/RewardVideoMediaPlayer.java
View file @
68d366e7
...
@@ -48,6 +48,10 @@ public class RewardVideoMediaPlayer {
...
@@ -48,6 +48,10 @@ public class RewardVideoMediaPlayer {
return
mMediaPlayer
;
return
mMediaPlayer
;
}
}
public
Activity
getActivity
()
{
return
mActivity
;
}
public
void
setHcAdBean
(
HcAdBean
mHcAdBean
)
{
public
void
setHcAdBean
(
HcAdBean
mHcAdBean
)
{
try
{
try
{
this
.
mHcAdBean
=
mHcAdBean
;
this
.
mHcAdBean
=
mHcAdBean
;
...
...
zxhcsdk/src/main/java/com/ym/zxhcsdk/ads/RewardVideoPortraitADActivity.java
View file @
68d366e7
...
@@ -46,6 +46,7 @@ public class RewardVideoPortraitADActivity extends Activity implements SurfaceHo
...
@@ -46,6 +46,7 @@ public class RewardVideoPortraitADActivity extends Activity implements SurfaceHo
private
Timer
mTimer
;
//倒计时
private
Timer
mTimer
;
//倒计时
private
final
int
countDownWhat
=
0
;
private
final
int
countDownWhat
=
0
;
private
boolean
isSetDisplay
=
false
;
private
boolean
isSetDisplay
=
false
;
private
boolean
isVideoCompletion
=
false
;
//是否播放完成
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
@@ -109,6 +110,7 @@ public class RewardVideoPortraitADActivity extends Activity implements SurfaceHo
...
@@ -109,6 +110,7 @@ public class RewardVideoPortraitADActivity extends Activity implements SurfaceHo
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
RewardVideoMediaPlayer
.
getInstance
().
clickVideoAd
();
RewardVideoMediaPlayer
.
getInstance
().
clickVideoAd
();
RewardVideoAdClick
();
}
}
});
});
//初始化SurfaceHolder类,SurfaceView的控制器
//初始化SurfaceHolder类,SurfaceView的控制器
...
@@ -149,10 +151,10 @@ public class RewardVideoPortraitADActivity extends Activity implements SurfaceHo
...
@@ -149,10 +151,10 @@ public class RewardVideoPortraitADActivity extends Activity implements SurfaceHo
}
}
};
};
//TODO 点击按钮,跳转的落地页, 或者是软件下载地
//TODO 点击按钮,跳转的落地页, 或者是软件下载地
//址。(可通过 target_type 字段判断是到普通
//址。(可通过 target_type 字段判断是到普通
//落地页还是下载 app,唤醒则通过 deeplink 是
//落地页还是下载 app,唤醒则通过 deeplink 是
//否为空判断) 确认video_endbutoonurl 具体含义 以及跳转Web的路径
//否为空判断) 确认video_endbutoonurl 具体含义 以及跳转Web的路径
private
void
RewardVideoAdClick
()
{
private
void
RewardVideoAdClick
()
{
boolean
IsSuccess
=
true
;
boolean
IsSuccess
=
true
;
if
(
TextUtils
.
isEmpty
(
RewardVideoMediaPlayer
.
getInstance
().
getHcAdBean
().
getDeeplink
()))
{
if
(
TextUtils
.
isEmpty
(
RewardVideoMediaPlayer
.
getInstance
().
getHcAdBean
().
getDeeplink
()))
{
...
@@ -168,7 +170,7 @@ public class RewardVideoPortraitADActivity extends Activity implements SurfaceHo
...
@@ -168,7 +170,7 @@ public class RewardVideoPortraitADActivity extends Activity implements SurfaceHo
}
}
}
}
}
else
if
(
RewardVideoMediaPlayer
.
getInstance
().
getHcAdBean
().
getTarget_type
().
equals
(
"1"
))
{
}
else
if
(
RewardVideoMediaPlayer
.
getInstance
().
getHcAdBean
().
getTarget_type
().
equals
(
"1"
))
{
new
HcDownLoadUtils
(
this
).
downloadAPK
(
RewardVideoMediaPlayer
.
getInstance
().
getHcAdBean
());
new
HcDownLoadUtils
(
RewardVideoMediaPlayer
.
getInstance
().
getActivity
()
).
downloadAPK
(
RewardVideoMediaPlayer
.
getInstance
().
getHcAdBean
());
}
}
}
}
}
else
{
}
else
{
...
@@ -192,7 +194,7 @@ public class RewardVideoPortraitADActivity extends Activity implements SurfaceHo
...
@@ -192,7 +194,7 @@ public class RewardVideoPortraitADActivity extends Activity implements SurfaceHo
}
}
}
}
}
else
if
(
RewardVideoMediaPlayer
.
getInstance
().
getHcAdBean
().
getTarget_type
().
equals
(
"1"
))
{
}
else
if
(
RewardVideoMediaPlayer
.
getInstance
().
getHcAdBean
().
getTarget_type
().
equals
(
"1"
))
{
new
HcDownLoadUtils
(
this
).
downloadAPK
(
RewardVideoMediaPlayer
.
getInstance
().
getHcAdBean
());
new
HcDownLoadUtils
(
RewardVideoMediaPlayer
.
getInstance
().
getActivity
()
).
downloadAPK
(
RewardVideoMediaPlayer
.
getInstance
().
getHcAdBean
());
}
}
}
}
}
}
...
@@ -246,7 +248,9 @@ public class RewardVideoPortraitADActivity extends Activity implements SurfaceHo
...
@@ -246,7 +248,9 @@ public class RewardVideoPortraitADActivity extends Activity implements SurfaceHo
public
void
surfaceCreated
(
@NonNull
SurfaceHolder
holder
)
{
public
void
surfaceCreated
(
@NonNull
SurfaceHolder
holder
)
{
Log
.
d
(
"wxw"
,
"surfaceCreated"
);
Log
.
d
(
"wxw"
,
"surfaceCreated"
);
RewardVideoMediaPlayer
.
getInstance
().
getMediaPlayer
().
setDisplay
(
surfaceHolder
);
RewardVideoMediaPlayer
.
getInstance
().
getMediaPlayer
().
setDisplay
(
surfaceHolder
);
RewardVideoMediaPlayer
.
getInstance
().
startVideo
();
if
(!
isVideoCompletion
)
{
RewardVideoMediaPlayer
.
getInstance
().
startVideo
();
}
isSetDisplay
=
true
;
isSetDisplay
=
true
;
}
}
...
@@ -262,6 +266,7 @@ public class RewardVideoPortraitADActivity extends Activity implements SurfaceHo
...
@@ -262,6 +266,7 @@ public class RewardVideoPortraitADActivity extends Activity implements SurfaceHo
public
void
OnCompletionListener
()
{
public
void
OnCompletionListener
()
{
TopClose
.
setVisibility
(
View
.
VISIBLE
);
TopClose
.
setVisibility
(
View
.
VISIBLE
);
TopTimeTv
.
setVisibility
(
View
.
GONE
);
TopTimeTv
.
setVisibility
(
View
.
GONE
);
isVideoCompletion
=
true
;
}
}
/**
/**
...
@@ -287,10 +292,10 @@ public class RewardVideoPortraitADActivity extends Activity implements SurfaceHo
...
@@ -287,10 +292,10 @@ public class RewardVideoPortraitADActivity extends Activity implements SurfaceHo
@Override
@Override
protected
void
onResume
()
{
protected
void
onResume
()
{
super
.
onResume
();
super
.
onResume
();
if
(
RewardVideoMediaPlayer
.
getInstance
().
isPrepared
)
{
if
(
isSetDisplay
)
{
if
(
isSetDisplay
)
{
if
(
!
isVideoCompletion
)
{
if
(!
RewardVideoMediaPlayer
.
getInstance
().
getMediaPlayer
().
isPlaying
())
{
if
(!
RewardVideoMediaPlayer
.
getInstance
().
getMediaPlayer
().
isPlaying
())
{
RewardVideoMediaPlayer
.
getInstance
().
getMediaPlayer
().
start
();
RewardVideoMediaPlayer
.
getInstance
().
startVideo
();
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment