Skip to main content

OTT Linear TV (incl. FAST) Ads

This SDK allows you to play ads when a viewer enters live HLS/DASH content, or insert replacement ads by processing the playlist manifest (m3u8 or mpd) using ad markers.

Ad Types​

Main Stream Replacement Ads​

This ad type replaces the main content stream using ad markers (e.g., SCTE-35). When a replacement ad plays or finishes, the SDK sends events to the host service.

Channel Entry Ads​

These ads play before a viewer enters the main content stream. When a viewer requests to watch live content, they will first see the entry ad. Once the entry ad finishes, the viewer will seamlessly transition to the main content stream. Note that when using channel entry ads, the app does not need to start playback manually, as the main content stream starts automatically after the entry ad finishes. Starting playback manually may briefly expose the main content video, degrading the UX.

View Layer Arrangement​

The AdView must be the same size as the view in which the main player is placed and overlap that view completely.

AdView is displayed transparently by default, and "Show more" or "Skip" buttons or overlay advertisements can be displayed on it if needed.

Application Architecture​

The player uses the media stream URL provided through the SDK. The SDK manipulates the manifest (m3u8/mpd) or routes segments to replace main content with ads, so no special player-side configuration is needed.

Pre-roll Ads​

A channel pre-roll is the channel entry ad described above. It is enabled by passing prerollAdTagUrl to changeChannelUrl, and it is independent of the main stream replacement ads: it is played in the AdView.

  • Flow: changeChannelUrl requests the pre-roll together with the channel and returns the media stream URL as usual. When the pre-roll is ready, the SDK starts it by itself — the app does not call play for it — and pauses the content player while it runs. When it ends, the SDK fires onCompleted and resumes the content player.
  • No ad or failure: if the pre-roll tag returns no ad, or the request fails, the SDK fires onCompleted and the channel starts as usual. With changeChannelUrl, a pre-roll whose playback fails also ends with onCompleted, not onError.
  • When the app starts playback: when the app calls changeChannelUrl itself, it holds the returned URL and sets it on the player at onCompleted, so the main content does not flash on screen before the pre-roll. When the SDK's player integration manages the channel (for example an SDK-provided player), the player holds the channel itself. Follow the Linear TV guide of your platform.
  • Channel switch: every changeChannelUrl call stops the current session first, including a pre-roll in progress, and then requests the pre-roll of the new call. Pass the new channel's prerollAdTagUrl to play its pre-roll.
  • Restart after onError: the app repeats the first call unchanged, prerollAdTagUrl included. If the channel has not changed, the pre-roll is skipped, and the SDK fires onCompleted as for a pre-roll with no ad. stop() does not count as a channel change; a VOD or inline ad request does, so A → B → A or A → VOD → A plays A's pre-roll again.
  • User leaving the app: by default, a pre-roll pauses when the app reports that the user left the app (notifyUserLeftApp(true)) and resumes when the user returns, in the same way as VOD ads. Main stream replacement ads keep playing.

Lifecycle​

A flowchart showing the entire process of registering an ad event listener and replacing ads while playing the main content.

Legend
 Function call made by you  Event fired by SDK ⭐ Optional