Class ImaServerSideAdInsertionMediaSource.AdsLoader.Builder

    • Constructor Detail

      • Builder

        public Builder​(Context context,
                       AdViewProvider adViewProvider)
        Creates an instance.
        Parameters:
        context - A context.
        adViewProvider - A provider for ViewGroup instances.
    • Method Detail

      • setImaSdkSettings

        @CanIgnoreReturnValue
        public ImaServerSideAdInsertionMediaSource.AdsLoader.Builder setImaSdkSettings​(com.google.ads.interactivemedia.v3.api.ImaSdkSettings imaSdkSettings)
        Sets the IMA SDK settings.

        If this method is not called, the default settings will be used with the language set to the preferred system language.

        Parameters:
        imaSdkSettings - The ImaSdkSettings.
        Returns:
        This builder, for convenience.
      • setAdEventListener

        @CanIgnoreReturnValue
        public ImaServerSideAdInsertionMediaSource.AdsLoader.Builder setAdEventListener​(com.google.ads.interactivemedia.v3.api.AdEvent.AdEventListener adEventListener)
        Sets the optional AdEvent.AdEventListener that will be passed to BaseManager.addAdEventListener(AdEventListener).
        Parameters:
        adEventListener - The ad event listener.
        Returns:
        This builder, for convenience.
      • setAdErrorListener

        @CanIgnoreReturnValue
        public ImaServerSideAdInsertionMediaSource.AdsLoader.Builder setAdErrorListener​(com.google.ads.interactivemedia.v3.api.AdErrorEvent.AdErrorListener adErrorListener)
        Sets the optional AdErrorEvent.AdErrorListener that will be passed to BaseManager.addAdErrorListener(AdErrorEvent.AdErrorListener).
        Parameters:
        adErrorListener - The AdErrorEvent.AdErrorListener.
        Returns:
        This builder, for convenience.
      • setCompanionAdSlots

        @CanIgnoreReturnValue
        public ImaServerSideAdInsertionMediaSource.AdsLoader.Builder setCompanionAdSlots​(Collection<com.google.ads.interactivemedia.v3.api.CompanionAdSlot> companionAdSlots)
        Sets the slots to use for companion ads, if they are present in the loaded ad.
        Parameters:
        companionAdSlots - The slots to use for companion ads.
        Returns:
        This builder, for convenience.
        See Also:
        BaseDisplayContainer.setCompanionSlots(Collection)
      • setFocusSkipButtonWhenAvailable

        @CanIgnoreReturnValue
        public ImaServerSideAdInsertionMediaSource.AdsLoader.Builder setFocusSkipButtonWhenAvailable​(boolean focusSkipButtonWhenAvailable)
        Sets whether to focus the skip button (when available) on Android TV devices. The default setting is true.
        Parameters:
        focusSkipButtonWhenAvailable - Whether to focus the skip button (when available) on Android TV devices.
        Returns:
        This builder, for convenience.
        See Also:
        AdsRenderingSettings.setFocusSkipButtonWhenAvailable(boolean)