LinearAdUiConfig
@objc(BMPLinearAdUiConfig)
@objcMembers
public class LinearAdUiConfig : NSObject, @unchecked Sendable
Configuration object for the LinearAd UI.
In case Bitmovin Player UI is used, message placeholders such as:
{remainingTime}
, {adDuration}
or {playedTime}
are available to customize the ad messages.
When using the System UI, only {remainingTime}
is supported.
Example:
let linearAdUiConfig = LinearAdUiConfig()
linearAdUiConfig.message = "This ad will end in {remainingTime}"
linearAdUiConfig.untilSkippableMessage = "This ad is skippable in {remainingTime}"
linearAdUiConfig.skippableMessage = "You can skip this ad now."
// Create an `AdItem` with one `AdSource` of type `.bitmovin`
let adItem = AdItem(
adSources: [AdSource(tag: adTagUrl, ofType: .bitmovin)],
// Configure the ad as a pre-roll ad
atPosition: "pre",
// Provide a LinearAdUiConfig instance to customize the ad UI messages
linearAdUiConfig: linearAdUiConfig
)
-
Specifies whether the ad needs a UI. Default is
true
Declaration
Swift
public var requestsUi: Bool
-
Message that gets displayed while an ad is active. Default is
nil
.Declaration
Swift
public var message: String?
-
Message that gets displayed while a skippable ad is not yet skippable. Default is
nil
.Declaration
Swift
public var untilSkippableMessage: String?
-
Message that gets displayed after the ad becomes skippable. Default is
nil
.Declaration
Swift
public var skippableMessage: String?