Package com.theoplayer.android.api.ads
Interface Ads
-
- All Implemented Interfaces:
-
com.theoplayer.android.api.event.EventDispatcher
public interface Ads implements EventDispatcher<E>
The Ads API which can be used to schedule as well as get information related to a group of advertisements.
-
-
Method Summary
Modifier and Type Method Description abstract boolean
isPlaying()
Returns whether a linear ad is currently playing. abstract List<Ad>
getCurrentAds()
Returns a list of the currently active Ad (linear and/or non linear). abstract AdBreak
getCurrentAdBreak()
Returns the active AdBreak (containing the currently playing Ad). abstract List<Ad>
getScheduledAds()
Returns a list of Ads that still needs to be played. abstract void
schedule(AdDescription adDescription)
Schedules an ad. abstract void
skip()
Skips the current linear ad. abstract Omid
getOmid()
The Omid instance. -
-
Method Detail
-
isPlaying
abstract boolean isPlaying()
Returns whether a linear ad is currently playing.
- Only available with the 'Unified Android' SDK.
- Refers to if ad is shown on screen.
-
getCurrentAds
@NonNull() abstract List<Ad> getCurrentAds()
Returns a list of the currently active Ad (linear and/or non linear).
- If there are no ads playing, the method returns an empty list.
- Only available with the 'Unified Android' SDK.
-
getCurrentAdBreak
@Nullable() abstract AdBreak getCurrentAdBreak()
Returns the active AdBreak (containing the currently playing Ad).
- Only available with the 'Unified Android' SDK.
-
getScheduledAds
@NonNull() abstract List<Ad> getScheduledAds()
Returns a list of Ads that still needs to be played.
- Only available in the STANDARD ad integration.
- Only available with the 'Unified Android' SDK.
-
schedule
abstract void schedule(AdDescription adDescription)
Schedules an ad. It will be added on top of the already existing ads.
- Alternatively, if you want to replace the ads with new ones or set ads while setting up the player, you should set a SourceDescription with an AdDescription.
- This function will have no effect if an invalid AdDescription is provided.
- Parameters:
adDescription
- The ad to schedule.
-
skip
abstract void skip()
Skips the current linear ad.
- This is only possible if the player has already played beyond the point in time where it can be skipped.
- This will have no effect when the current linear ad is not (yet) skippable.
-
-
-
-