AdsConfiguration

@objc(THEOplayerAdsConfiguration)
public class AdsConfiguration : NSObject, Encodable

The advertisement configuration of the player.

  • Whether an advertisement duration countdown will be shown in the UI.

    Remark

    • Defaults to true.

    Declaration

    Swift

    @objc
    public private(set) var showCountdown: Bool { get }
  • The preload type of the ad, whether media files of mid- and postrolls are preloaded.

    Remark

    • Defaults to MIDROLL_AND_POSTROLL.

    Declaration

    Swift

    @objc
    public private(set) var preload: AdPreloadType { get }
  • The configuration of the Google Interactive Media Ads.

    Declaration

    Swift

    @available(*, deprecated, renamed: "googleIma")
    @objc
    public var googleImaConfiguration: GoogleIMAAdsConfiguration { get }
  • The configuration of the Google Interactive Media Ads.

    Declaration

    Swift

    @objc
    public var googleIma: GoogleIMAAdsConfiguration { get }
  • The configuration of Google Dynamic Ad Insertion.

    Declaration

    Swift

    @objc
    public let googleDai: GoogleDAIAdsConfiguration?
  • Constructs an AdsConfiguration object.

    Declaration

    Swift

    @objc
    public init(showCountdown: Bool, preload: AdPreloadType, googleIma: GoogleIMAAdsConfiguration? = nil, googleDai: GoogleDAIAdsConfiguration? = nil)

    Parameters

    showCountdown

    Whether an advertisement duration countdown will be shown in the UI, defaults to true.

    preload

    The preload type of the ad, whether media files of mid- and postrolls are preloaded, defaults to MIDROLL_AND_POSTROLL.

    googleIma

    The configuration of the Google Interactive Media Ads, defaults to nil.

    googleDai

    The configuration of Google Dynamic Ad Insertion, defaults to nil.

  • Constructs an AdsConfiguration object.

    Declaration

    Swift

    @available(*, deprecated, message: "This init method will be removed in future versions because of a deprecated property `googleImaConfiguration`. Please use the init method with `googleIma` parameter instead.")
    @objc
    public init(showCountdown: Bool, preload: AdPreloadType, googleImaConfiguration: GoogleIMAAdsConfiguration?)

    Parameters

    showCountdown

    Whether an advertisement duration countdown will be shown in the UI, defaults to true.

    preload

    The preload type of the ad, whether media files of mid- and postrolls are preloaded, defaults to MIDROLL_AND_POSTROLL.

    googleImaConfiguration

    The configuration of the Google Interactive Media Ads, defaults to nil.