Implementing an early ad break return

Last update: 2023-10-02

For live stream ad insertion, you might need to exit from an ad break before all the ads in the break are played to completion.


You must subscribe to the splice out/in ad markers ( #EXT-X-CUE-OUT, #EXT-X-CUE-IN, and #EXT-X-CUE).

Here are some requirements to consider:

  • Parse markers such as EXT-X-CUE-IN (or equivalent marker tag) that appear in the linear or FER streams.

    Register the markers as being the marker for ad early return point. Only play adBreaks until this marker position during playback, which override the duration of the adBreak marked by the leading EXE-X-CUE-OUT marker.

  • If two EXT-X-CUE-IN markers exist for the same EXT-X-CUE-OUT marker, the first EXT-X-CUE-IN marker that appears is the one that counts.

  • If the EXE-X-CUE-IN marker appears in the timeline without a leading EXT-X-CUE-OUT marker, the EXE-X-CUE-IN marker is discarded.

    In a live stream, if the leading EXT-X-CUE-OUT marker has just moved out of the window, the TVSDK will not respond to it.

  • When there is an early return from an ad break, the adBreak plays until the playhead returns to the original position when the ad break was supposed to end and resumes playing the main content from that position.

SpliceOut and SpliceIn

SpliceOut and SpliceIn markers mark the begin and the end of the ad break. The duration of the SpliceOut type of the EXE-X-CUE marker might be zero and the SpliceIn type of EXE-X-CUE marker marks the end of the ad break. They appear in one tag and differ by type.

One marker with different types

For example, here is one marker with different types:




In the one marker with different types example, if the duration of the SpliceOut type is zero, the SpliceOut and SpliceIn must work together for every ad break. Currently, a SpliceOut marker with a non-zero duration and doesn’t need pairing SpliceIn markers is more typical.

Two separate markers

The more typical scenario is a SpliceOut marker with a non-zero duration and that does not need the pairing SpliceIn markers. Here, a pairing SpliceIn marker marks the end the ad break during ad break playback, but the ad break is cut short at the SpliceIn marker position, and the main content starts playing at this position.

For example, here are two separate markers:


On this page