There are a few ways to determine ad insertion and ad placement.
Here is an overview of the process used to determine ad insertion:
The TVSDK can get locations for possible ad placement from the following sources:
The TVSDK detects the cues, extracts the necessary information from these cues, and communicates with an advertising server to get the corresponding ads. This source is common for live/linear streams.
The TVSDK usually replaces main content with the ads at the location that is indicated by the metadata/cues; otherwise, the client would drop more and more behind the actual live point.
The advertising server map
Usually, metadata about these streams is registered in the advertising server before playback. The TVSDK retrieves the ad timeline and corresponding ads from the server. This source is common for VOD streams.
The TVSDK usually inserts the resolved ads into the main content as indicated by the server map.
By default, the TVSDK uses manifest cues for live/linear streams and advertising server maps for VOD streams. However, to support full-event replay for live events, your application must take extra steps.