Instream ads are video ads that are shown over an existing video player of the host app. They can be shown before, after, or at any point during video content with a seamless transition to or from video content.
| class | InstreamAd.InstreamAdLoadCallback | An object for receiving event notifications of loading an instream ad. | |
| abstract void |
destroy()
Destroys the
InstreamAd.
|
| abstract float |
getAspectRatio()
This method is deprecated. Use
getAspectRatio().
|
| abstract MediaContent |
getMediaContent()
Get the
MediaContent
associated with this ad.
|
| abstract VideoController |
getVideoController()
This method is deprecated. Use
getVideoController().
|
| abstract float |
getVideoCurrentTime()
This method is deprecated. Use
getCurrentTime().
|
| abstract float |
getVideoDuration()
This method is deprecated. Use
getDuration().
|
| static void |
load(Context
context, String adUnitId,
AdRequest
adRequest, int mediaAspectRatio,
InstreamAd.InstreamAdLoadCallback loadCallback)
Loads an
InstreamAd
from AdMob.
|
| static void |
load(Context
context, String adTagUrl,
InstreamAd.InstreamAdLoadCallback loadCallback)
Loads an
InstreamAd
from Google Ad Manager.
|
Destroys the InstreamAd. No other methods should be called on the ad
object after destroy()
is called.
This method is deprecated.
Use getAspectRatio().
Gets the aspect ratio (the ratio of width to height) of the loaded instream ad.
Get the MediaContent
associated with this ad.
This method is deprecated.
Use getVideoController().
Gets the VideoController
of the ad.
This method is deprecated.
Use getCurrentTime().
Gets the current time of the instream video in seconds.
This method is deprecated.
Use getDuration().
Gets the duration of the instream video in seconds.
Loads an InstreamAd
from AdMob.
| context | The context. |
|---|---|
| adUnitId | The AdMob ad unit ID. |
| adRequest | An AdRequest
object containing request information. |
| mediaAspectRatio | The type of MediaAspectRatio
that the loaded instream ad should have. Instream ad requests only support the
LANDSCAPE
and PORTRAIT
aspect ratio types. LANDSCAPE
is used by default if an unsupported MediaAspectRatio
is provided. |
| loadCallback | An object that handles instream ad loading events. |
Loads an InstreamAd
from Google Ad Manager.
| context | The context. |
|---|---|
| adTagUrl | The Ad Manager ad tag URL. |
| loadCallback | An object that handles instream ad loading events. |