AdItem
@objc(BMPAdItem)
@objcMembers
public class AdItem : NSObject
Represents an ad break which can be scheduled for playback.
-
The
AdSource
s that make up thisAdItem
. The first ad source in this array is used as the main ad. Subsequent ad sources act as a fallback, meaning that if the main ad source does not provide a valid response, the subsequent ad sources will be utilized one after another.Declaration
Swift
public let sources: [AdSource]
-
The playback position at which the ad break is scheduled to start. Will play as a pre-roll ad when set to
nil
.Declaration
Swift
public let position: String?
-
Provides customisation options when the advertising UI when Bitmovin Player UI is used.
Declaration
Swift
public let linearAdUiConfig: LinearAdUiConfig
-
Creates a new
AdItem
with an array ofAdSource
s as pre-roll ads.Declaration
Swift
public convenience init(adSources sources: [AdSource])
Parameters
sources
The
AdSource
s that make up thisAdItem
. The first ad source in this array is used as the main ad. Subsequent ad sources act as a fallback, meaning that if the main ad source does not provide a valid response, the subsequent ad sources will be utilized one after another. -
Creates a new
AdItem
with an array ofAdSource
s scheduled for the given position.Declaration
Swift
public convenience init(adSources sources: [AdSource], atPosition position: String?)
Parameters
sources
The
AdSource
s that make up thisAdItem
. The first ad source in this array is used as the main ad. Subsequent ad sources act as a fallback, meaning that if the main ad source does not provide a valid response, the subsequent ad sources will be utilized one after another.position
The playback position at which the ad break is scheduled to start. Will play as a pre-roll ad when set to
nil
. Value of position can be: -
Creates a new
AdItem
with an array ofAdSource
s scheduled for the given position.Declaration
Swift
public init( adSources sources: [AdSource], atPosition position: String?, linearAdUiConfig: LinearAdUiConfig )
Parameters
sources
The
AdSource
s that make up thisAdItem
. The first ad source in this array is used as the main ad. Subsequent ad sources act as a fallback, meaning that if the main ad source does not provide a valid response, the subsequent ad sources will be utilized one after another.position
The playback position at which the ad break is scheduled to start. Will play as a pre-roll ad when set to
nil
. Value of position can be:linearAdUiConfig
Configuration for the advertising UI when Bitmovin Player UI is used. Has no effect when not using
AdSourceType.bitmovin
.