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()