JWAdsAdvertisingConfigBuilder
@objcMembers
public class JWAdsAdvertisingConfigBuilder : NSObject, JWBuilder
Used to build a JWAdvertisingConfig object to play ads using the JWPlayer 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
@objc public func build() throws -> JWAdvertisingConfig -
Sets a VMAP URL.
Declaration
Swift
@discardableResult public func vmapURL(_ vmapURL: URL) -> JWAdsAdvertisingConfigBuilderParameters
vmapURLEither a local or remote URL of the vmap file.
Return Value
The builder, so setters can be chained.
-
Sets an array of
JWAdBreakobjects that provide information about ad breaks.Declaration
Swift
@discardableResult public func schedule(_ schedule: [JWAdBreak]) -> JWAdsAdvertisingConfigBuilderParameters
scheduleAn array of
JWAdBreakobjects 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.Declaration
Swift
@discardableResult public func tag(_ tag: URL) -> JWAdsAdvertisingConfigBuilderParameters
tagThe URL of the VAST tag to display.
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) -> JWAdsAdvertisingConfigBuilderParameters
adRulesDefines playback rules for the scheduled ads.
Return Value
The builder, so setters can be chained.
-
Sets whether or not the player should open the default browser after the user clicks an ad. The default value is
true.Note
Applicable to JW ad client only.Declaration
Swift
@discardableResult public func openBrowserOnAdClick(_ openBrowserOnAdClick: Bool) -> JWAdsAdvertisingConfigBuilderParameters
openBrowserOnAdClickWhether or not the player should open the default browser after the user clicks an ad.
Return Value
The builder, so setters can be chained.
-
Sets the number of seconds to wait before enabling the skip button.
The value set here will take priority over any value set in the VAST XML, or in
JWAdInterfaceStyle. However, if there is a value set in aJWAdBreak, the value in the ad break will take priority.Note
Ifnilis specified the skip ad button won’t be displayed at all.Declaration
Swift
@discardableResult public func skipOffset(_ offset: TimeInterval?) -> JWAdsAdvertisingConfigBuilderParameters
offsetThe number of seconds to wait before enabling the skip ad button.
Return Value
The builder, so setters can be chained.
-
Sets the JWPlayer client ad settings.
Declaration
Swift
@discardableResult public func adSettings(_ settings: JWAdSettings) -> JWAdsAdvertisingConfigBuilderParameters
settingsA
JWAdSettingsobject.Return Value
The builder, so setters can be chained.
JWAdsAdvertisingConfigBuilder Class Reference