public class RewardedVideoAd extends java.lang.Object implements FullScreenAd
RewardedVideoAd ad = new RewardedVideoAd(context, placementId);
RewardedVideoLoadAdConfig loadAdConfig = ad.buildLoadAdConfig()
.withBid(bidPayload)
.withAdListener(adListener)
.build();
ad.loadAd(loadAdConfig);
Modifier and Type | Class and Description |
---|---|
static interface |
RewardedVideoAd.RewardedVideoAdLoadConfigBuilder
Builder that allows to configure an ad loading.
|
static interface |
RewardedVideoAd.RewardedVideoAdShowConfigBuilder
Builder that allows to configure an ad showing.
|
static interface |
RewardedVideoAd.RewardedVideoLoadAdConfig
Marker interface for an object that represents an rewarded video ad load config.
|
static interface |
RewardedVideoAd.RewardedVideoShowAdConfig
Marker interface for an object that represents an rewarded video ad show config.
|
FullScreenAd.ShowAdConfig, FullScreenAd.ShowConfigBuilder
Ad.LoadAdConfig, Ad.LoadConfigBuilder
Modifier and Type | Field and Description |
---|---|
static int |
UNSET_VIDEO_DURATION |
Constructor and Description |
---|
RewardedVideoAd(Context context,
java.lang.String placementID)
Constructs a RewardedVideoAd given the context and the placement id
|
Modifier and Type | Method and Description |
---|---|
RewardedVideoAd.RewardedVideoAdLoadConfigBuilder |
buildLoadAdConfig()
Returns
RewardedVideoAd.RewardedVideoAdLoadConfigBuilder
that allows to specify ad loading parameters. |
RewardedVideoAd.RewardedVideoAdShowConfigBuilder |
buildShowAdConfig()
Returns
RewardedVideoAd.RewardedVideoAdLoadConfigBuilder
that allows to specify ad showing parameters. |
void |
destroy()
Destroys the ad control.
|
void |
enableRVChain(boolean enabled)
Deprecated.
since 5.6, use
loadAd(RewardedVideoAd.RewardedVideoLoadAdConfig) |
java.lang.String |
getPlacementId()
Get the placementId for this ad.
|
int |
getVideoDuration() |
boolean |
isAdInvalidated()
Indicate whether the ad is still valid.
|
boolean |
isAdLoaded()
Tells whether an ad is loaded and ready to show
|
void |
loadAd()
Loads an ad.
|
void |
loadAd(boolean failOnCacheFailure)
Deprecated.
since 5.6, use
loadAd(RewardedVideoAd.RewardedVideoLoadAdConfig) |
void |
loadAd(RewardedVideoAd.RewardedVideoLoadAdConfig rewardedVideoLoadAdConfig)
Loads an ad.
|
void |
loadAdFromBid(java.lang.String bidPayload)
Deprecated.
since 5.6, use
loadAd(RewardedVideoAd.RewardedVideoLoadAdConfig) |
void |
loadAdFromBid(java.lang.String bidPayload,
boolean failOnCacheFailure)
Deprecated.
since 5.6, use
loadAd(RewardedVideoAd.RewardedVideoLoadAdConfig) |
void |
setAdListener(RewardedVideoAdListener adListener)
Deprecated.
since 5.6, use
loadAd(RewardedVideoAd.RewardedVideoLoadAdConfig) |
void |
setExtraHints(ExtraHints extraHints) |
void |
setRewardData(RewardData rewardData)
Deprecated.
since 5.6, use
loadAd(RewardedVideoAd.RewardedVideoLoadAdConfig) |
boolean |
show()
Shows the rewarded video ad
This method should only be called after
loadAd()
is called and the ad listener has been notified ad has loaded |
boolean |
show(int appOrientation)
Deprecated.
since 5.6, use
show(RewardedVideoAd.RewardedVideoShowAdConfig) |
boolean |
show(RewardedVideoAd.RewardedVideoShowAdConfig rewardedVideoShowAdConfig)
Shows the rewarded video ad
|
public static final int UNSET_VIDEO_DURATION
public RewardedVideoAd(Context context, java.lang.String placementID)
context
- Android contextplacementID
- id of ad placementpublic void setExtraHints(ExtraHints extraHints)
setExtraHints
in interface Ad
@Deprecated public void enableRVChain(boolean enabled)
loadAd(RewardedVideoAd.RewardedVideoLoadAdConfig)
public void loadAd()
Ad
This method always returns immediately. The ad is loaded asynchronously. The control's ad listener will be called when loading finishes or fails.
public void loadAd(RewardedVideoAd.RewardedVideoLoadAdConfig rewardedVideoLoadAdConfig)
This method always returns immediately. The ad is loaded asynchronously. The control's ad listener will be called when loading finishes or fails.
RewardedVideoAd ad = new RewardedVideoAd(context, placementId);
RewardedVideoLoadAdConfig loadAdConfig = ad.buildLoadAdConfig()
.withBid(bidPayload)
.withAdListener(adListener)
.build();
ad.loadAd(loadAdConfig);
@Deprecated public void loadAd(boolean failOnCacheFailure)
loadAd(RewardedVideoAd.RewardedVideoLoadAdConfig)
@Deprecated public void loadAdFromBid(java.lang.String bidPayload)
loadAd(RewardedVideoAd.RewardedVideoLoadAdConfig)
Ad
loadAdFromBid
in interface Ad
bidPayload
- The payload supplied with the bid@Deprecated public void loadAdFromBid(java.lang.String bidPayload, boolean failOnCacheFailure)
loadAd(RewardedVideoAd.RewardedVideoLoadAdConfig)
bidPayload
- failOnCacheFailure
- public boolean isAdInvalidated()
Ad
isAdInvalidated
in interface Ad
public boolean show()
loadAd()
is called and the ad listener has been notified ad has loadedshow
in interface FullScreenAd
public boolean show(RewardedVideoAd.RewardedVideoShowAdConfig rewardedVideoShowAdConfig)
This method should only be called after loadAd()
is called and the ad listener has been notified ad has loaded
RewardedVideoShowAdConfig showAdConfig = ad.buildShowAdConfig()
.withAppOrientation(appOrientation)
.build();
ad.show(showAdConfig);
rewardedVideoShowAdConfig
- rewarded video ad config.@Deprecated public boolean show(int appOrientation)
show(RewardedVideoAd.RewardedVideoShowAdConfig)
loadAd()
is called and the ad listener has been notified ad has loadedappOrientation
- orientation of the calling app@Deprecated public void setAdListener(RewardedVideoAdListener adListener)
loadAd(RewardedVideoAd.RewardedVideoLoadAdConfig)
adListener
- public void destroy()
Ad
This method should be called when the hosting activity of the ad control is destroyed.
public boolean isAdLoaded()
public java.lang.String getPlacementId()
Ad
getPlacementId
in interface Ad
@Deprecated public void setRewardData(RewardData rewardData)
loadAd(RewardedVideoAd.RewardedVideoLoadAdConfig)
rewardData
- public int getVideoDuration()
public RewardedVideoAd.RewardedVideoAdLoadConfigBuilder buildLoadAdConfig()
RewardedVideoAd.RewardedVideoAdLoadConfigBuilder
that allows to specify ad loading parameters.
You should call loadAd(RewardedVideoAd.RewardedVideoLoadAdConfig)
after all parameters have been set.buildLoadAdConfig
in interface FullScreenAd
public RewardedVideoAd.RewardedVideoAdShowConfigBuilder buildShowAdConfig()
RewardedVideoAd.RewardedVideoAdLoadConfigBuilder
that allows to specify ad showing parameters.
You should call show(RewardedVideoAd.RewardedVideoShowAdConfig)
after all parameters have been set.buildShowAdConfig
in interface FullScreenAd