JWImaAdvertisingConfigBuilder

@objcMembers
public class JWImaAdvertisingConfigBuilder : NSObject, JWBuilder

Used to build a JWAdvertisingConfig object to play ads using the IMA client.

  • Declaration

    Swift

    public typealias Output = JWAdvertisingConfig
  • Builds an advertising config based off the settings provided.

    Throws

    throws An error if the config is not setup properly.

    Declaration

    Swift

    public func build() throws -> JWAdvertisingConfig
  • Sets a VMAP URL.

    Declaration

    Swift

    @discardableResult
    public func vmapURL(_ vmapURL: URL) -> JWImaAdvertisingConfigBuilder

    Parameters

    vmapURL

    Either a local or remote URL of the vmap file.

    Return Value

    The builder, so setters can be chained.

  • Sets an array of JWAdBreak objects that provide info about ad breaks.

    Note

    If an ad schedule is also set using tag(), calling build() will throw an exception.

    Declaration

    Swift

    @discardableResult
    public func schedule(_ schedule: [JWAdBreak]) -> JWImaAdvertisingConfigBuilder

    Parameters

    schedule

    An array of JWAdBreak objects that provide information about ad breaks.

    Return Value

    The builder, so setters can be chained.

  • Sets the URL of the VAST tag.

    Note

    Can also specify the VAST VMAP file to use for ad breaks.

    Note

    If an ad schedule is also set using schedule(), calling build() will throw an exception.

    Declaration

    Swift

    @discardableResult
    @objc
    public func tag(_ tag: URL) -> JWImaAdvertisingConfigBuilder

    Parameters

    tag

    The URL of the VAST tag.

    Return Value

    The builder, so setters can be chained.

  • Sets the rules for how often a user sees ads while watching the video content.

    Declaration

    Swift

    @discardableResult
    public func adRules(_ adRules: JWAdRules) -> JWImaAdvertisingConfigBuilder

    Parameters

    adRules

    Defines playback rules for the scheduled ads.

    Return Value

    The builder, so setters can be chained.

  • The container with obstructions that should be marked as friendly.

    Note

    The viewability measurement may be affected if obstructions above the player view are not registered properly.

    Note

    If the friendly obstructions array is modified, it will be registered until the next ad schedule is loaded or the current playlist item is replayed.

    Declaration

    Swift

    @discardableResult
    public func friendlyObstructionsContainer(_ container: JWFriendlyObstructionsContainer) -> JWImaAdvertisingConfigBuilder