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:
changeChannelUrlrequests 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 callplayfor it — and pauses the content player while it runs. When it ends, the SDK firesonCompletedand resumes the content player. - No ad or failure: if the pre-roll tag returns no ad, or the request fails, the SDK fires
onCompletedand the channel starts as usual. WithchangeChannelUrl, a pre-roll whose playback fails also ends withonCompleted, notonError. - When the app starts playback: when the app calls
changeChannelUrlitself, it holds the returned URL and sets it on the player atonCompleted, 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
changeChannelUrlcall 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'sprerollAdTagUrlto play its pre-roll. - Restart after
onError: the app repeats the first call unchanged,prerollAdTagUrlincluded. If the channel has not changed, the pre-roll is skipped, and the SDK firesonCompletedas 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