Skip to content

Fix #1296: configurable video interstitial auto-close - #1305

Open
mdanylov-sigma wants to merge 3 commits into
masterfrom
fix/1296_configurable_video_autoclose
Open

Fix #1296: configurable video interstitial auto-close#1305
mdanylov-sigma wants to merge 3 commits into
masterfrom
fix/1296_configurable_video_autoclose

Conversation

@mdanylov-sigma

@mdanylov-sigma mdanylov-sigma commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a publisher-configurable isAutoCloseOnCompletionEnabled flag (default true, preserving existing behavior) on VideoControlsConfiguration, exposed on InterstitialRenderingAdUnit, RewardedAdUnit, and MediationBaseInterstitialAdUnit. When disabled, a full-screen video interstitial without a companion/end card no longer auto-dismisses when playback completes — the publisher (or the rewarded close-action flow) controls when it closes.

Closes #1296

Behavior

  • Default (true): unchanged from current behavior — video without a companion still auto-closes on completion.
  • false: [modalManager creativeDisplayCompleted:] is still called unconditionally (so rewarded completion is still reported to ModalManager and rewarded close-action handling — closeButton/autoClose/unknown — still runs correctly), but the automatic dismissInterstitialModalState() call is skipped.
  • Non-rewarded interstitials without a companion still get a close ("X") button via the existing closeDelay countdown in ModalViewController, independent of this flag, so they can never get stuck.

Testing

  • PrebidMobileTests (unit): 25/25 passed, including new tests:
    • testInterstitialWithoutCompanionAutoClosesByDefault
    • testInterstitialWithoutCompanionCanDisableAutoClose
    • testRewardedCompletionIsReportedWhenAutoCloseIsDisabled — explicitly verifies ModalManager.creativeDisplayCompleted(_:) still fires for a rewarded ad when auto-close is disabled.
    • testAutoCloseOnCompletion (config default/override)
  • PrebidDemoSwiftUITests (real UI test, live ad serving): testInAppVideoInterstitialAd passed.

API / compatibility

  • Additive @objcMembers property, consistent with the existing isSoundButtonVisible pattern across all three ad unit surfaces — no Objective-C interop concerns, no breaking changes, default preserves current behavior for existing integrations.

@OlenaPostindustria

OlenaPostindustria commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

When isAutoCloseOnCompletionEnabled is set to false, the video just ends without providing an option to replay. Since video banners have a Watch Again button in this scenario, would it make sense to make the behaviour consistent? Alternatively, we could have the video automatically loop until the ad is closed.

@OlenaPostindustria OlenaPostindustria left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left a suggestion

@OlenaPostindustria

Copy link
Copy Markdown
Collaborator

It would also be good to document the new property in the public documentation

@OlenaPostindustria OlenaPostindustria left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@YuriyVelichkoPI YuriyVelichkoPI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please support new property in ORTBAdConfiguration and update the spec for Ad Experience Controls respectively

https://docs.prebid.org/prebid-mobile/modules/rendering/combined-ad-experience-controls.html

@mdanylov-sigma

Copy link
Copy Markdown
Collaborator Author

Addressed in 097c52d: the value now parses through ORTBAdConfiguration, rewarded ads defer to rwdd.close.action, and the public documentation update is in prebid/prebid.github.io#6697.

@YuriyVelichkoPI YuriyVelichkoPI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Video interstitials without an end card auto-close after playback — no API to disable auto-close and require an explicit close

3 participants