Package 

Interface Ads

  • 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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • 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.
      • 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.