Instance Property
shouldPlayAdItem
Callback that will be called once for every AdItem shortly before it would start playing. If true is returned, the ad item will play. If false is returned, the ad item will be discarded and removed from the schedule.
var shouldPlayAdItem: (AdItem) -> Bool
Default Behavior
All ad items are played by default.
Relation to other Ad-Filtering callbacks
Together these three callbacks define the ad-filtering pipeline:
Load-time (shouldLoadAdItem)
Seek-time (shouldPlaySeekedOverAdItems)
Play-time (shouldPlayAdItem)
Limitations
When seeking over multiple ad breaks in a VMAP schedule, the Google IMA SDK determines which ad breaks to play. Typically, only the last ad break fires the AD_BREAK_READY event. As a result:
This callback will only be triggered for ad breaks that the IMA SDK signals as ready.
Earlier ad breaks are handled internally by the IMA SDK and this callback is not invoked for them.
The player cannot intercept or override this IMA SDK behavior.
The same behavior occurs if a start offset is configured that skips ad breaks scheduled before the specified start time.