Skip to main content
Use this when you already insert ads on the server with AWS Elemental MediaTailor for video on demand. IL serves your own HLS with the breaks marked and the context of each break. MediaTailor copies that context into its request to your ad server, so each break can get a different, contextual ad. The player does not change: only the stream URL changes, and the player plays the MediaTailor URL like any other. If your inserter is not MediaTailor, IL has two other outputs with the same breaks: a VMAP per video for an inserter that accepts it as its ad server, and a content source feed for Google DAI, which is still Not verified. Scene graphics need the content clock IL writes into the marked playlists; a stream built from a VMAP or by Google DAI does not carry it. An inserter other than MediaTailor does not use the IL SDK.

What you need

  • MediaTailor already in use, with a playback configuration you can edit.
  • An ad server connected in Settings → Adservers: Google Ad Manager or iADServer.
  • Videos imported by HLS URL and analysed. See Asset catalog.

Steps

  1. In Settings → General → How does your player connect?, choose Server-side insertion. Under Who inserts the ads?, choose My AWS MediaTailor. You can choose MediaTailor operated by IL manually when IL has enabled the service for your account. The other two options are Another inserter (VMAP URL) and Google DAI: see below. Settings then shows the tabs General · Adservers · Delivery · MediaTailor · API keys; the server-insertion tab is named MediaTailor, Your inserter or Google DAI after who inserts, and shows only that inserter’s values.
  2. In Settings → Delivery, choose the Ad server for the breaks (Google Ad Manager or iADServer; for iADServer, its iADServer video tag), Pre-roll when the video starts and Mid-roll every (minutes). Each mid-roll moves to the nearest scene end that passes Content Safety; a blocked moment gets no break.
  3. In Settings → MediaTailor, copy the two values into your MediaTailor playback configuration:
    • Content source → MediaTailor’s Video content source. It has the form https://<console host>/ssai/v1/{project_id}/.
    • Ad server URL → MediaTailor’s Ad decision server. The tab shows the URL only for the ad server chosen in Delivery. Until you choose one, it says: «You have not chosen the ad server for the breaks yet. Choose it in Delivery to see the URL that goes into MediaTailor.»
  4. Play <your MediaTailor HLS prefix>/{asset_id}/master.m3u8 in your player.
  5. Create the key-values in your ad server. In Google Ad Manager, create the custom targeting keys ilayers_link, ilayers, ilayers_context and ilayers_iab (the same ones ILPlayer campaigns use). The values arrive on their own.

The ad server URL

For Google Ad Manager, IL builds it from the VAST tag of the chosen profile. It keeps the tag’s parameters (iu, sz, description_url…) and adds:
The profile’s own key-values travel inside IL_GAM in each marker, so they are visible in each video’s public playlist (they were already public in the client-side tag for ILPlayer projects). For iADServer, IL builds it from the video tag chosen in Delivery, and iADServer judges the moment vid + cue_seconds with IL’s analysis:

What IL puts in the playlist

IL serves /ssai/v1/{project_id}/{asset_id}/master.m3u8 and one r{n}.m3u8 per playlist, with relative URIs and no query strings, so a video’s URL does not change if it is imported again. Every source line is kept as is; segment URIs become absolute to your origin, and MediaTailor never downloads segments from IL. Each variant and each alternative audio or subtitle playlist gets the same markers. When you imported a single media playlist, IL builds a one-variant master from what the import measured, because MediaTailor rejects a media playlist as its source. Before the segment where each break starts, IL adds three lines:
The zero-duration break inserts the ads at that point without replacing content. A marker before the first segment inserts the pre-roll. Values are percent-encoded, and a key without a value is not sent. In MediaTailor, [asset.KEY] names are case-sensitive, and a key missing on a break becomes empty text.

What is left

Settings → General → What is left shows three steps with their real status:
  1. An ad server connected.
  2. A video imported by HLS URL and analysed.
  3. A marked video of this project was requested: IL notes a request for a variant or audio playlist (not the master) at most every 5 minutes per project. It cannot tell who asked: MediaTailor forwards the viewer’s User-Agent and has no header of its own.

Behaviour to expect

  • MediaTailor requests the ads of all breaks together when the session starts, when the first variant playlist is requested.
  • No ad, an empty VAST or an ad MediaTailor is still preparing leaves the video untouched.
  • MediaTailor prepares each new ad for each quality of the video. The first plays of a new ad go without it for minutes (21 in one test, about 3 in another).
  • MediaTailor reports impressions and quartiles to the ad server from the server, once per ad and session, when the player downloads the ad’s segments, not when they are watched. Players buffer ahead, so an ad can be reported as seen before the viewer reaches it.
  • Without a plan (video not analysed, no ad server connected, AdRouter on), the video plays without IL breaks.
  • If the video changed on your CDN since you imported it, it plays without breaks and the MediaTailor tab says so for that video: import it again and analyse it.

What AWS bills

AWS charges you for each ad MediaTailor places in a viewer session’s playlists, at the moment the player requests them, whether or not the ad is watched. In video on demand all breaks are decided when the session starts, so a viewer who opens a video with six breaks and leaves is six insertions. Inserted ads are not impressions, and automated requests to the playback URL count too. An ad MediaTailor skips while it is still preparing a new creative is not billed. The MediaTailor tab says the same: «AWS bills you for every ad MediaTailor places in the video the player asks for, whether it is watched or not: these are not impressions, and automated requests to your URL count too.»

Scene graphics with the IL SDK in your player

With server-side insertion, MediaTailor inserts the pre-roll and mid-roll video ads. If your web player also has the IL SDK, the SDK draws the scene formats (Super, L and Overlay 300×250) over the content, and never over an inserted ad. So that the SDK knows when content is on screen, IL marks the content in the playlists it gives MediaTailor: it writes a #EXT-X-PROGRAM-DATE-TIME line on every content segment, and MediaTailor keeps those lines on content segments and writes none on ad segments. The ad plan the SDK reads carries a timeline of kind stitched and no video cuts: the video ads stay with MediaTailor.

Turn it on

This option appears in General when IL has enabled scene graphics for the project. MediaTailor can insert the video breaks on its own. The following steps add graphics to program scenes in a compatible web player.
  1. In Settings → General, open Choose the integration manually, choose Server-side insertion, and answer Yes to Does your player have the IL SDK?.
  2. Under Which one or ones?, tick your players.
  3. Settings → Delivery then shows Scene graphics in your player. The scene graphics are requested from Google Ad Manager; the video breaks go to the ad server MediaTailor uses, which may be another one.
  4. What is left, in General, adds the steps Load the IL SDK with the plan and the content clock and The requested videos can carry scene graphics, and shows the code to add.

The code to add to the player

With hls.js:
The session and attachAds use the same clock (programTime: clock.programTime). For another player, only the clock changes: shakaContentClock({ player, plan }) for Shaka Player, videoJsContentClock({ player: vjs, plan }) for Video.js with VHS, and nativeHlsContentClock({ video, plan, playlistUrl: session.manifestUrl }) for Safari’s native HLS, which works only with an explicit MediaTailor session manifest. Each clock answers the seconds of content on screen, or null while an ad is on screen or the position cannot be known, and the SDK draws nothing then. The Player SDK guide lists the clocks. A host that uses only the session, without attachAds, passes inAd: clock.inAd to its adapter; attachAds does it by itself. The content clocks are in SDK revision d522f5e or later.

What was tested on a real MediaTailor

A real AWS MediaTailor stream: a 96 s HLS video with two video renditions and a separate audio rendition, with a pre-roll and one mid-roll. With the IL SDK (commit 9cfb748), hls.js, Video.js, ILPlayer 0.7.1 and Safari’s native HLS (tested with the WebKit engine and an explicit MediaTailor session, not on an iPhone or in the Safari app on a Mac) each played the stitched stream to the end. A frame-by-frame check found no graphic over an ad frame, and each scene window made its Google Ad Manager request and impression. Only the Super format was exercised. In another run, the web SDK ad module was tested in Chrome with hls.js 1.5.17 on a real MediaTailor stream, checking every frame: no SDK graphic over an ad frame, a Super crossing a break was seen on both sides and hidden during the break, the Overlay 300×250 (with Google Publisher Tag’s public test unit) was hidden 0.8 s before the break, and one impression per window. Not tested there: a real non-linear answer from Google Ad Manager (the Super and the L used a test-supplied VAST), nor other browsers.

Product with Buy in the scene

When the scene product is on for your project, the plan also carries the product windows in content seconds, and the SDK shows the card with Buy using the same clock, never over an inserted ad. With Yes under Does your player have the IL SDK?, Delivery offers Product with a Buy button if every chosen player shows it (HTML5 with hls.js, Video.js and Shaka). Buy during an ad is not compatible: MediaTailor requests the ad, outside the viewer’s session, and nothing is shown during an inserted ad. It was tested in a browser on a real AWS MediaTailor stream in a test account: a synthetic 300 s HLS with two renditions and the audio in the same rendition, IL’s marked playlists, IL’s plan for that video and Google’s public sample ad in all three breaks. With hls.js, Shaka and Video.js in Chromium and with WebKit’s native HLS (explicit MediaTailor session), no card or panel appeared over an ad frame, the card appeared in its window before and after the break with one request and one impression per window, and an open panel closed when the ad started. That run tested only the scene product. It was not tested on real Safari or iOS, on a TV, on a publisher’s production stream, with DRM, or with the audio in a separate rendition. That test found two web SDK defects that are now fixed (Shaka drew nothing over a MediaTailor stream, and with Video.js an open panel could show on the ad’s first frame): use an SDK build from November 24, 2026 or later.

VMAP per video, for other inserters

For a server-side inserter that accepts a VMAP as its ad server, without reading marks in the playlists, IL publishes a VMAP 1.0 per video. Your origin and your player do not change. In Settings → General → Who inserts the ads?, choose Another inserter (VMAP URL) (“It works if your inserter accepts a VMAP URL as its ad server. We tested it with AWS MediaTailor.”). The Your inserter tab shows:
  • VMAP URL for your inserter, with {asset_id} and {session} to replace with the video’s IL id and the viewer’s session (without a session, remove ?sid={session});
  • Example for one video;
  • If your inserter is AWS MediaTailor: ad decision server URL, ready to paste;
  • the warning that the URL holds a secret key, and Regenerate the key, which asks for confirmation because the current URL stops working at once;
  • the warning not to combine it with IL’s marked video URLs, which stop answering for the project with this inserter.
The URL has this form:
The URL contains a secret. The VMAP carries your ad server URL (the Google Ad Manager network and ad unit, or the iADServer tag). That is why {key} is a random project key. Put it only in the inserter’s configuration: never in a page, a player or a public repository. With Regenerate the key, the old URL stops working at once and you must update every inserter. A wrong key gets the same 404 as an unknown project. The response carries no CORS headers, so a browser cannot read it from another page.
  • Same breaks as the marked playlists. Each <vmap:AdBreak> is an IL break. timeOffset is the start of the segment where the break goes, in HH:MM:SS.mmm, and the pre-roll is start. breakId is pre or mid-{n}.
  • Same ad request. Each <vmap:AdTagURI> is your ad server URL filled in with that break’s values, as MediaTailor would fill it from a mark, with a new correlator per break in every response. So do not store or reuse a VMAP across sessions: Google answers empty to a repeated correlator.
  • sid. Identifies the viewer’s session for iADServer. Only letters, digits, ., _ and - are accepted, up to 128 characters. Without sid, the parameter is removed from the request instead of being sent empty.
  • Videos without breaks. An enabled video with no plan, or whose origin changed since import, answers an empty VMAP: the inserter places no ads and the content plays. An unknown project or video answers 404, like the marked playlists.
  • Do not combine it with the marked playlists. The inserter must read your origin, not /ssai/v1/…/master.m3u8: with IL’s marks and the VMAP at once, ads would be inserted twice.
To try it with MediaTailor, use your origin as the content source and this URL as the ad decision server, with ?ads.il_asset=<asset_id> in the playback URL:
What was tested. With a real AWS MediaTailor in VMAP mode, in a test account: a synthetic 300 s HLS without marks, Google Ad Manager as the ad server with Google’s public sample ad unit, and breaks at 0, 60 and 240 s. IL built the VMAP and a static copy was published before each session. In five sessions, MediaTailor accepted the VMAP, inserted the ads at IL’s timeOffsets in both renditions, made one request per break identical to the AdTagURI and, from the second session on, filled all three breaks (the first came out empty while MediaTailor prepared the new ad). What was not tested. The live URL with MediaTailor’s variables ([player_params.il_asset], ads.il_asset, [session.id] and the key in a URL requested by MediaTailor), iADServer as the VMAP’s ad server, and any other inserter, such as Google Video Stitcher, Yospace or broadpeak.io. Depending on the network, Google Ad Manager may answer VAST 4.x even though the VMAP declares vast3.

Google DAI: content source feed with IL’s breaks

Status: Not verified. Google DAI for video on demand does not take a VMAP: Ad Manager ingests your HLS from a content source (an MRSS feed) and reads each video’s mid-rolls from <dfpvideo:cuepoints>. For a project with Google DAI, IL publishes that feed. In Settings → General → Who inserts the ads?, choose Google DAI (“Built from Google’s documentation; we have not tested it on a real network.”). The ad server of your breaks must be Google Ad Manager; if it is not, the Console asks you to choose it in Delivery first. The Google DAI tab shows the Feed URL for Ad Manager with its secret-key warning and Regenerate the key, how many videos the feed has, the steps In Google Ad Manager, and that no real Ad Manager network has imported it and Google gets the context of the whole video, not each break’s. If the ad server of the breaks stops being Google Ad Manager, the tab says the feed is stopped. The URL has this form:
The URL contains a secret. The feed lists your origin URLs, so {key} is another random project key, different from the VMAP’s. Put it only in the Ad Manager content source. With Regenerate the key, the old URL stops working. A wrong key, another project or a project without Google DAI get the same 404 as an unknown project. Each video imported by HLS URL, ready, with a plan and with its origin unchanged since import is an <item> with:
  • dfpvideo:contentId, the IL video ID, and dfpvideo:lastModifiedDate;
  • dfpvideo:ingestUrl with your HLS master, without IL’s marks;
  • dfpvideo:cuepoints with IL’s mid-rolls, on the same segment boundaries the marked playlists use. There is no cue point at 0: the pre-roll is decided by your Ad Manager ad rules;
  • dfpvideo:keyvalues with the key-values that all the video’s mid-rolls carry with the same value.
  • Pages hold 50 videos, most recently modified first. lastModifiedDate changes only when something Google ingests changes: the cue points, the duration, the key-values, the URL or the title.
  • A published video that loses its plan, or whose origin changed, stays in the feed without <dfpvideo:cuepoints>, and Google reads it again without mid-rolls. A deleted video is listed with <media:status state="deleted"/> for 30 days.
  • A large catalog fills in gradually: at most 20 videos every 5 minutes, while something requests the feed. For 1,000 videos that is about 4 hours. The feed lists up to the 1,000 most recently imported videos.
  • With Google DAI, the project’s only ad server must be Google Ad Manager. If it stops being so, the feed answers 404 and Google keeps what it last ingested.
In Ad Manager:
  1. Create an MRSS content source (content sources) and paste the feed URL.
  2. Leave automatic sync on.
  3. Set up the ad rules for the pre-roll and the mid-rolls, which use the feed’s cue points (mid-rolls in DAI).
  4. Play with Google’s IMA DAI SDK, with the content source ID and the IL video ID as contentId.
What is known and what is not. The feed follows Google’s MRSS feed specification and no real Ad Manager network has ingested it. Google receives the positions of IL’s breaks and the context of the whole video, not each break’s context: a content source feed cannot carry per-break key-values, and a key-value that changes between breaks is not sent. The pre-roll is decided by the publisher’s ad rules.

Limits

  • One ad server for all breaks: MediaTailor has a single ad server URL per configuration, so ordered lists with alternatives do not apply.
  • Videos imported by HLS URL only: a master or a single media playlist, MPEG-TS or fMP4 with one file per segment. Byte ranges and encrypted HLS are not supported. A master needs an H.264 quality. Video on demand only.
  • In a master, a change that exists only in a query string of the analysed playlists is not seen as a new version: put the content’s version in the path, not in a query string.
  • Super, L and Overlay are drawn by players. With the player unchanged they do not apply; with the IL SDK in your web player, see Scene graphics with the IL SDK in your player, above. SpringServe shows Coming soon.
  • Scene graphics with the IL SDK:
    • With the audio in a separate rendition, Shaka Player does not play the stream MediaTailor builds, with or without the IL SDK. With video and audio in one rendition, Shaka draws the scene product over a real MediaTailor (see “Product with Buy in the scene”); the Super, the L and the Overlay with Shaka were not tested over a real MediaTailor.
    • The native SDKs (Android, Apple, Roku, Samsung Tizen) do not draw over a stitched stream.
    • Buy is not offered during a server-inserted ad.
    • To close an open product panel over an inserted ad, the content clock’s inAd() needs the ads between discontinuities (#EXT-X-DISCONTINUITY) and at least one dated segment in each content run. A stitched playlist with no discontinuity tags, or native HLS whose variants disagree, does not close the panel over the ad (graphics are still never drawn over it). In a live window of a stream that dates only some of its content segments, the panel can close during content. Streams that date every content segment, as MediaTailor does, are not affected.
    • Scene graphics are requested from Google Ad Manager.
    • If your origin already writes #EXT-X-PROGRAM-DATE-TIME, or #EXT-X-DATERANGE without it, in a video, IL adds no clock and that video carries no scene graphics. The MediaTailor tab says so for that video.

Tested and not tested

  • Tested against real MediaTailor (VOD): the zero-duration marker form, one request per break with [asset.KEY], encoded values passed byte for byte, the same breaks in two variants, the empty VAST, the pre-roll, markers in separate audio and in WebVTT, the master built by IL and the r{n} playlists as served.
  • Tested in a real player: a stitched ladder with two video qualities, separate AAC audio and WebVTT, with three breaks (a pre-roll and two mid-rolls), played end to end in Google Chrome with hls.js, with no player errors and no stalls.
  • Not tested without the IL SDK: Safari’s native HLS and other players. With the IL SDK, see Scene graphics with the IL SDK in your player, above.
  • Server-side Google Ad Manager was not tested against a real network: vpos, correlator=[avail.random] and cust_params=[asset.IL_GAM] follow Google’s and MediaTailor’s documentation (the shape of cust_params was checked in the requests MediaTailor made, not in Google’s response). ip and the user agent are not added because the pages consulted do not ask for them.
Advertising providers · Asset catalog