InstreamVideoAdView

InstreamVideoAd displays a Instream video advertisement by Facebook

To use the Instream video, do the following:

InstreamVideoAdView InstreamVideo = new InstreamVideoAdView(context, PLACEMENT_ID); InstreamVideoView.setAdListener(new AbstractAdListener() { public void onAdLoaded(Ad ad) { } });

InstreamVideoView.loadAd();

拡張:RelativeLayout
実装:Ad
パッケージ:ads
コンストラクター
InstreamVideoAdView(Context, String, AdSize)

Constructs a InstreamVideoAdView given the context and the placement id

public InstreamVideoAdView(Context context, String placementID, AdSize adSize)
パラメーター説明
contextAndroid context
placementIDId of ad placement eg. 12345_12345
adSizeThe intended size of the placement
インスタンスメソッド
loadAd()

Loads an 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()
loadAd()
public void loadAd()
show()

Shows the Instream video ad

This method should only be called after InstreamVideoAdView.loadAd() is called and the ad listener has been notified ad has loaded

public boolean show()
Returns
False if no ad is loaded, true otherwise
setAdListener(InstreamVideoAdListener)

Sets an InstreamVideoAdListener to be notified on events in control lifecycle.

public void setAdListener(InstreamVideoAdListener adListener)
パラメーター説明
adListener
destroy()

Destroys the ad control.

This method should be called when the hosting activity of the ad control is destroyed.

public void destroy()
destroy()
public void destroy()
isAdLoaded()

Tells whether an ad is loaded and ready to show

public boolean isAdLoaded()
Returns
Whether an ad is loaded
getPlacementId()

Get the placementId for this ad.

public String getPlacementId()
Returns
PlacementId String representing the placementId for this ad.
getPlacementId()
public String getPlacementId()