Skip to main content

Non Linear Ads

Non linear pause ads display an ad overlay inside the player when playback is paused. Configure pause ads under ads.nonLinear.pause.

Pause Ads​

AttributeTypeRequiredDescription
provider"generic"noProvider of the pause ad configuration.
genericNonLinearPauseGenericConfigurationnoGeneric non linear pause ad configuration.
generic.urlStringnoURL for the VAST tag that includes non linear ads.
generic.xPosition.Left | .Center | .RightnoHorizontal position of the non linear ad display area.
generic.yPosition.Top | .Center | .BottomnoVertical position of the non linear ad display area.
generic.backgroundOpacityDoublenoBackground opacity of the ad display area.
generic.slideAnimationNonLinearSlideAnimationConfigurationnoSlide animation configuration for the non linear ad.
generic.slideAnimation.enabledBoolnoWhether slide animation is enabled.
generic.slideAnimation.direction.Left | .Right | .Up | .DownnoSlide animation direction.
generic.slideAnimation.durationDoublenoSlide animation duration in seconds.
generic.paddingNonLinearPaddingConfigurationnoPadding around the non linear ad display area.
generic.padding.topStringnoTop padding in accepted units.
generic.padding.bottomStringnoBottom padding in accepted units.
generic.padding.leftStringnoLeft padding in accepted units.
generic.padding.rightStringnoRight padding in accepted units.
generic.rotationIntervalSecondsDoublenoInterval in seconds between pause ad rotation attempts while the player stays paused. When the displayed creative has been visible for this long, a new ad is requested from the VAST tag and the creative is replaced with a different eligible one. Defaults to 15; 0 disables rotation.
let config = LuraPlayerConfiguration(
ads: .init(
nonLinear: .init(
pause: .init(
provider: "generic",
generic: .init(
url: "VAST_AD_TAG_URL_WITH_NON_LINEAR_ADS",
xPosition: .Right,
yPosition: .Center,
backgroundOpacity: 0.6,
slideAnimation: .init(
enabled: true,
direction: .Left,
duration: 0.6
),
padding: .init(
right: "5%"
),
rotationIntervalSeconds: 30
)
)
)
)
)
player?.setConfig(config)

The cooldown between pause ad displays is controlled by ads.policy.pauseAdCooldown.