Instance Property
shouldPlaySeekedOverAdItems
Called during every forward seek or timeshift operation where AdItems are scheduled in between the original time and the seek target time. The return value decides which ad breaks will play after the seek or timeshift operation finishes.
var shouldPlaySeekedOverAdItems: (_ seekedOverAdItems: [AdItem]) -> [AdItem]
Relation to other Ad-Filtering callbacks
Together these three callbacks define the ad-filtering pipeline:
Load-time (shouldLoadAdItem)
Seek-time (shouldPlaySeekedOverAdItems)
Play-time (shouldPlayAdItem) Default Behavior
seekedOverAdItems includes all the AdItems for the time span that was jumped over (both non-Interstitial ads and HLS Interstitials):
If the list contains no HLS Interstitials:
If the list contains any HLS Interstitials:
If those interstitials contain one or more pre-rolls, all pre-rolls will play.
If all of those interstitials are non jump-restricted, no ad items play.
Otherwise, plays only the last jump-restricted interstitial.
In either case above, non-Interstitial ads in the list are not played by default.
Note
Items you do not return are discarded silently (without emitting any event or status change).
Note
Discarded ad items are removed before loading. However, some may already have been loaded in these cases:
For non-Interstitial ad breaks: if the playhead was within a configured offset of the AdItem’s scheduled time.
For HLS Interstitial ad breaks: if the forward buffer had already approached the AdItem’s scheduled time.
Note
Post-rolls cannot be seeked-over, and hence cannot be discarded by this callback.
Note
Pause ads are non-timeline opportunities and are not passed to this callback.
Note
The callback will be called for startOffset adjustments via startOffset.
Usage Example
To always play only the last item after seeking or timeshifting over ad breaks:
advertisingConfig.shouldPlaySeekedOverAdItems = { seekedOverAdItems in
guard let lastItem = seekedOverAdItems.last else { return [] }
return [lastItem]
}