-
- All Implemented Interfaces:
-
com.theoplayer.android.api.event.EventDispatcher
public interface Ads implements EventDispatcher<AdEvent>
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 voidrequestPlaying(RequestCallback<Boolean> callback)Requests whether a linear ad is currently playing. abstract booleanisPlaying()Returns whether a linear ad is currently playing. abstract voidrequestCurrentAds(RequestCallback<List<Ad>> callback)Requests a list of the currently active ads (linear and/or non linear). abstract List<Ad>getCurrentAds()Returns a list of the currently active Ad (linear and/or non linear). abstract voidrequestCurrentAdBreak(RequestCallback<AdBreak> callback)Requests the active AdBreak (containing the currently playing Ad). abstract AdBreakgetCurrentAdBreak()Returns the active AdBreak (containing the currently playing Ad). abstract voidrequestScheduledAds(RequestCallback<List<Ad>> callback)Requests a list of ads that still needs to be played. abstract List<Ad>getScheduledAds()Returns a list of Ads that still needs to be played. abstract voidschedule(AdDescription adDescription)Schedules an ad. abstract voidskip()Skips the current linear ad. abstract OmidgetOmid()The Omid instance. -
-
Method Detail
-
requestPlaying
@Deprecated() abstract void requestPlaying(RequestCallback<Boolean> callback)
Requests whether a linear ad is currently playing.
Deprecated: Superseded by isPlaying, since v3.4.0.
- Parameters:
callback- A closure to invoke when operation completes or fails.
-
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.
-
requestCurrentAds
@Deprecated() abstract void requestCurrentAds(RequestCallback<List<Ad>> callback)
Requests a list of the currently active ads (linear and/or non linear).
Deprecated: Superseded by getCurrentAds, since v3.4.0.
- If there are no ads playing, the method returns an empty list.
- Parameters:
callback- A closure to invoke when operation completes or fails.
-
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.
-
requestCurrentAdBreak
@Deprecated() abstract void requestCurrentAdBreak(RequestCallback<AdBreak> callback)
Requests the active AdBreak (containing the currently playing Ad).
Deprecated: Superseded by getCurrentAdBreak, since v3.4.0.
- Parameters:
callback- A closure to invoke when operation completes or fails.
-
getCurrentAdBreak
@Nullable() abstract AdBreak getCurrentAdBreak()
Returns the active AdBreak (containing the currently playing Ad).
- Only available with the 'Unified Android' SDK.
-
requestScheduledAds
@Deprecated() abstract void requestScheduledAds(RequestCallback<List<Ad>> callback)
Requests a list of ads that still needs to be played.
Deprecated: Superseded by getScheduledAds, since v3.4.0.
- Only available in the STANDARD ad integration.
- Parameters:
callback- A closure to invoke when operation completes or fails.
-
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.
-
-
-
-