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
| Attribute | Type | Required | Description |
|---|---|---|---|
| provider | "generic" | no | Provider of the pause ad configuration. |
| generic | NonLinearPauseGenericConfiguration | no | Generic non linear pause ad configuration. |
| generic.url | String | no | URL for the VAST tag that includes non linear ads. |
| generic.xPosition | .Left | .Center | .Right | no | Horizontal position of the non linear ad display area. |
| generic.yPosition | .Top | .Center | .Bottom | no | Vertical position of the non linear ad display area. |
| generic.backgroundOpacity | Double | no | Background opacity of the ad display area. |
| generic.slideAnimation | NonLinearSlideAnimationConfiguration | no | Slide animation configuration for the non linear ad. |
| generic.slideAnimation.enabled | Bool | no | Whether slide animation is enabled. |
| generic.slideAnimation.direction | .Left | .Right | .Up | .Down | no | Slide animation direction. |
| generic.slideAnimation.duration | Double | no | Slide animation duration in seconds. |
| generic.padding | NonLinearPaddingConfiguration | no | Padding around the non linear ad display area. |
| generic.padding.top | String | no | Top padding in accepted units. |
| generic.padding.bottom | String | no | Bottom padding in accepted units. |
| generic.padding.left | String | no | Left padding in accepted units. |
| generic.padding.right | String | no | Right padding in accepted units. |
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%"
)
)
)
)
)
)
player?.setConfig(config)
The cooldown between pause ad displays is controlled by ads.policy.pauseAdCooldown.