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. abstract void
registerServerSideIntegration(@NonNull() String integrationId, @NonNull() ServerSideAdIntegrationFactory integrationFactory)
Register a custom advertisement integration. -
-
Method Detail
-
isPlaying
abstract boolean isPlaying()
Returns whether a linear ad is currently playing.
- 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.
-
getCurrentAdBreak
@Nullable() abstract AdBreak getCurrentAdBreak()
Returns the active AdBreak (containing the currently playing Ad).
-
getScheduledAds
@NonNull() abstract List<Ad> getScheduledAds()
Returns a list of Ads that still needs to be played.
- Only available in the STANDARD ad integration.
-
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.
-
registerServerSideIntegration
@ApiStatus.Experimental() abstract void registerServerSideIntegration(@NonNull() String integrationId, @NonNull() ServerSideAdIntegrationFactory integrationFactory)
Register a custom advertisement integration.
This allows you to integrate with third-party advertisement providers, and have them report their ads and ad-related events through the THEOplayer Ads API.
This API is experimental and is subject to change in any minor version of THEOplayer. Please consult with THEO Technologies before using this API.
- Parameters:
integrationId
- An identifier of the integration.integrationFactory
- Factory that will construct an ServerSideAdIntegrationHandler for this integration.
-
-
-
-