public class InstreamVideoAdView extends RelativeLayout implements Ad
InstreamVideoAdView InstreamVideo = new InstreamVideoAdView(context, PLACEMENT_ID);
InstreamVideoView.setAdListener(new AbstractAdListener() {
public void onAdLoaded(Ad ad) {
}
});
InstreamVideoView.loadAd();
Constructor and Description |
---|
InstreamVideoAdView(Context context,
Bundle previousState) |
InstreamVideoAdView(Context context,
java.lang.String placementID,
AdSize adSize)
Constructs a InstreamVideoAdView given the context and the placement id
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroys the ad control.
|
java.lang.String |
getPlacementId()
Get the placementId for this ad.
|
Bundle |
getSaveInstanceState() |
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 |
loadAdFromBid(java.lang.String bidPayload)
Loads an ad from the payload supplied with a bid.
|
void |
setAdListener(InstreamVideoAdListener adListener)
Sets an InstreamVideoAdListener to be notified on events in control lifecycle.
|
void |
setExtraHints(ExtraHints extraHints) |
boolean |
show()
Shows the Instream video ad
This method should only be called after
loadAd()
is called and the ad listener has been notified ad has loaded |
public InstreamVideoAdView(Context context, Bundle previousState)
context
- previousState
- public InstreamVideoAdView(Context context, java.lang.String placementID, AdSize adSize)
context
- Android contextplacementID
- id of ad placement eg. 12345_12345adSize
- the intended size of the placementpublic 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 loadAdFromBid(java.lang.String bidPayload)
Ad
loadAdFromBid
in interface Ad
bidPayload
- The payload supplied with the bidpublic boolean isAdInvalidated()
Ad
isAdInvalidated
in interface Ad
public boolean show()
loadAd()
is called and the ad listener has been notified ad has loadedpublic void setAdListener(InstreamVideoAdListener adListener)
adListener
- public void setExtraHints(ExtraHints extraHints)
setExtraHints
in interface Ad
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
public Bundle getSaveInstanceState()