Skip to main content
A super is a lower-third graphic over full-size program video. An L-shaped ad scales the video to 75% of its original width and height, anchors it at the top left and displays artwork along the right and bottom edges. Audio continues in both formats. The host player or stitcher handles linear preroll and midroll spots and reports their actual boundaries to the graphics adapter. Already have a video service? The Academy guide shows where ads appear on screen and who handles each format when you keep your player, video stream or ad server. The embedded PDF follows the Academy language. Open the reader settings to switch between English and Spanish. Read the visual guide in Academy The SDK is distributed through a GitHub repository that requires access. Install or vendor the adapter and pin the revision that your app has verified. SDK source

Deliver a graphics cue

For HLS, publish com.interactivelayers.overlay in the media playlist. Provide compatible cues in all variants available to the session and anchor them with EXT-X-PROGRAM-DATE-TIME. Use one delivery path per cue.
A viewer-specific session feed returns a JSON array. The player supplies sid and time, the program time of the currently playing frame in Unix milliseconds. Use a fresh session identity on channel change and keep the feed and video on the same timeline.
The active interval is [start, end). An empty schedule or an unavailable media clock leaves full-size video. Use HTTPS for artwork and measurement. Capture an impression after the graphics are visible and assign one owner, either the adapter or the host according to the platform. A seek back into the window can display the creative again. It preserves a single impression per cue ID and session.

Ads from the plan in your web player

With My own player chosen in Settings → General and AdRouter off, your own web player can show the same ad plan as ILPlayer: pre-roll and mid-rolls from the ordered Google Ad Manager and iADServer steps, plus Super, L and Overlay 300×250 from Google Ad Manager. Use the optional @interactivelayers/player-sdk/ads module (attachAds, loadPlan, planUrl). The main SDK entry does not import it: without a plan, no ad code is loaded. Choose your web player under My own player → Which one or ones?; among web players, only Shaka, Video.js and HTML5 read the plan. For a native app, see Native apps. Player compatibility The browser reads the plan with GET https://console.interactivelayers.com/il-player/ad-plan?project=<project_id>&asset=<asset_id>, one request per view that the browser may cache for 5 minutes. It answers only to an HTTPS page on one of the project’s verified ILPlayer domains (the Origin header, same wildcard rules as the iframe), with CORS for that origin and no credentials. It returns 200 with the plan as JSON, or 204 when there is no current plan yet; one is prepared in the background and that view plays without ads. Any other request gets 404, like an unknown embed. The origin check stops hotlinking, it is not authentication: the plan is what any viewer of that page sees. It works for any video of the project, including videos imported by URL.
loadPlan never throws and returns the plan or null, which means play without ads this time. For on-demand video, attach the session with timeline: 'media'. The module requests the Super and the L from GAM as a non-linear VAST, validates the creative and draws it. The Overlay is requested with Google Publisher Tag and needs a stage of at least 640 × 360. It is shown only when the Display ad unit for the 300×250 Overlay is set in Settings → Adservers → Google Ad Manager. Each cut of the plan carries requests, the ad servers to ask in order (at most 3):
No URL carries a correlator. An iADServer request carries the exact cut time in cue_seconds, which can have decimals. The cut keeps tag_url only when its first request is a Google Ad Manager tag, for older SDK builds that read only tag_url. The plan version stays 1. In the module, ads.cuts is [{ id, at, position, tagUrl, requests: [{ provider, tagUrl }] }], with tagUrl equal to the first request’s. The module accepts only https://pubads.g.doubleclick.net/gampad/ads for gam and https://ads.iadserver.com/gampad/ads for iadserver, and drops a cut with no valid request. An older plan without requests gives one gam request per cut. Choose one way to run the ad breaks:
  1. Your own ad player: schedule ads.cuts and walk each cut’s requests as shown below.
  2. Your own IMA: pass ads.vmap() as the adsResponse of your AdsRequest. The VMAP carries only the first request of each cut, with no fallback.
  3. The module’s built-in player: linear: 'ima' plus an adContainer. Call ads.start() inside the viewer’s play gesture.
A player that schedules its own breaks walks the requests of each cut in order:
  1. Add a new correlator to the tagUrl on every attempt (also when repeating a request) and wait up to 5 seconds.
  2. An empty VAST, an error or the timeout moves to the next request.
  3. Stop at the first one that starts playing. If the list runs out, continue the content.
Use the same iADServer sid for the whole view: pass sessionId to attachAds if you already have your own identifier; otherwise the module generates one per attachAds. Hold the first play until the pre-roll starts or fails. With the built-in player, when a cut has more than one request the module schedules the breaks itself: it requests the pre-roll on start() and each mid-roll about 8 seconds ahead, and asks the next request when one returns empty, fails or does not answer in 5 seconds. During the pre-roll it holds the content itself, for up to 8 seconds; an ad that is already starting keeps its 5 seconds and is not cut off. Joining with the video already advanced skips the breaks left behind; a break the viewer seeks across during playback is requested (only the last one crossed). If the browser rejects the resume, onEvent receives { type: 'resume_blocked', cut }: show your play control. With your own ad integration, such as Shaka’s ad manager or Video.js with an IMA plugin, call ads.setBreakActive(true) when a break starts and ads.setBreakActive(false) when it ends, so graphics and the overlay stay out of the break. For diagnostics, onEvent reports request, fill, no_fill, error, impression and click for graphics and the overlay, and break_start, break_end and break_error for breaks. break_start arrives once per cut, followed by break_end or break_error; break_error means every request failed and can arrive without break_start, before the cut. Each attempt also reports { type: 'break_request', cut, provider, attempt } and, when it returns empty or fails, { type: 'break_no_fill', cut, provider, attempt }, with attempt starting at 1.

Breaks your page plays (per-break API)

If your backend requests each break from the per-break API and your own ad player plays them, attach that playback’s plan (GET /v1/vod/playbacks/{id}/plan, with cuts: []). With it the module neither requests nor plays video ads: it draws the scene graphics and Buy during your iADServer ads. Your page tells it what is happening:
  • Report the breaks. The module applies scenes.pacing.cut_clearance_seconds (and the commerce.pacing one to the product) only around the positions from setBreaks and breakStarted. Without breakStarted, graphics follow content time even during an ad and Buy never appears.
  • During a reported break nothing from IL is drawn except Buy, and a product opened earlier closes. If breakEnded() does not arrive within 120 s, the module ends the break and emits break_error. The module never touches your player.
  • Buy appears only for an iADServer ad with an il-shop-… Ad@id requested with its tag, and only when the plan carries commerce.break_url. Do not pass a sessionId other than commerce.session: the module says so once with buy_unavailable. Fetch ad_tag_url exactly as given.
  • Pass planOrigin (the IL console origin) when your backend fetched the plan.
Two changes for pages that already call setBreaks (ILPlayer included): setBreaks now records the positions even when the plan has no scenes, and the cut_clearance_seconds of commerce.pacing now also keeps the scene product windows clear of those breaks, not only the graphics windows. loadPlan now accepts version: 2 plans, also on the page route: a page that used to get null now attaches the plan and stops cleanly on expiry with plan_expired, without renewing it unless it uses keepPlanRenewed.

Product with a Buy button

When the plan carries commerce, the module asks IL for the product of each scene and draws it: the banner designed in iADServer when the campaign has one, or a product card. It is the same implementation ILPlayer uses. To turn it on, pass commerce to the adapter and, if you did not load the plan with loadPlan, tell attachAds where the plan came from:
  • Without commerce in the adapter (attachHtmlVideo, attachVideoJs, attachShaka), no product is requested. A plan without commerce changes nothing.
  • The banner stays as long as its campaign creative says. It ends earlier only before an ad break, before content that is sensitive or has not been analyzed, at the end of the video, or at a safety limit decided by IL (at most 60 seconds, or the shorter Maximum duration (s) set in Delivery). A product panel the viewer opened is not tied to that window: see How long the product panel stays, below.
  • The banner always shows a visible Buy button; if the design has its own, no other is added. A product and a Super or L never share a scene: when there is a product, the graphic is not requested.
  • On web, Buy prepares the cart and shows a link to continue to the store, plus a QR code when the page runs in an iframe. With commerce: { tv: true } the purchase is by QR code. commerce: { pauseOnOpen: true } pauses the video while the detail is open.
  • With linear: 'ima', a video ad linked to a product in iADServer shows Buy for that product until the ad ends, is skipped or fails; a panel the viewer opened stays (see How long the product panel stays, below). This needs commerce in the adapter and no sessionId of your own in attachAds.
  • The module fires the impression once, when the product is first visible, and the view once, when the detail opens. onEvent reports them with format: 'scene_product'.
  • The page needs connect-src for IL and https://ads.iadserver.com, and img-src https: for images and the QR code.
Limits:
  • With AdRouter on there is no ad plan. Without a plan, the module stays inactive.
  • iADServer steps need an iADServer video tag in the step and the video linked in the iADServer portal. Otherwise that step is skipped.
  • Scene graphics (Super, L and Overlay) come from Google Ad Manager only. The product with Buy comes from iADServer.
  • Super and L need a directly sold InLine ad with a static PNG or JPEG image over HTTPS in a 20:3 or 16:9 aspect ratio. Wrappers, linear ads and HTML or iframe resources are rejected.
  • The Overlay is a display unit shown over the video. Confirm Google’s policy for that unit and, until then, use it with direct or house campaigns.
  • The page that hosts the player must be served over HTTPS.
  • This module is for the web. Android, iOS, tvOS, Roku and Samsung Tizen apps read the plan with their own SDK: see Native apps.
Ads module guide

How long the product panel stays (web)

The scene graphic lasts exactly its window. A product panel the viewer opened stays open after its ad ends, with no time limit and with the content playing under it, until the viewer closes it. It closes when:
  • the viewer opens another product;
  • a new ad break starts (the panel of the ad that is playing stays; in a break with several ads, each new ad closes the previous ad’s product);
  • a server-inserted ad comes on screen (it closes on the ad’s first frame);
  • the media changes;
  • the session is destroyed or the player is removed from the page.
It does not close at the end of its cue, its ad or its break, on a seek, a pause or buffering, when the content resumes under it, or when a player recovers the same content. The impression and the product view are still sent once. What your host does:
  • The media change is detected by itself for a <video> playing a file or native HLS, for Video.js, for Shaka, and for hls.js when the SDK holds the hls object (with attachAds, or with a session given onMediaChange: clock.onMediaChange).
  • With hls.js without the SDK’s content clock, another Media Source player or Tizen AVPlay, call sdk.closeProduct() (or destroy the session) when you open other content.
  • On a stream with inserted ads, a host that uses only the session, without attachAds, passes inAd: clock.inAd to its adapter. attachAds does it by itself. inAd() is true from 200 ms before an ad starts, so a player paused just before an ad already counts as in the ad.
closeProduct(id?) is new, and inAd and onMediaChange are new session options. holdUntil on a cue or plan is ignored, and HOLD_MS and withinHold are no longer exported. If the viewer presses Buy and the ad server answers that the offer is gone, the card and the TV shop behave as the Android guide describes: the message «This offer is no longer available.» and no retry for that variant, while another variant can still be tried. This rule covers the web and Android SDKs and ILPlayer, which uses the web SDK; the Apple TV and Roku SDKs close the panel when its ad ends. It was tested in jsdom and in browser suites, not on a real TV, Tizen or webOS device. Closing over an inserted ad was also tested in a browser on a real MediaTailor test stream (see Server-side insertion).

Ads inserted in the stream (MediaTailor)

When MediaTailor inserts the video ads, the player only draws the scene graphics with the SDK. The module then schedules the scenes with a content clock, because video.currentTime is stream time (content plus ads). Create the clock for your player (hlsContentClock, shakaContentClock, videoJsContentClock or nativeHlsContentClock) and pass it to the session (programTime: clock.programTime) and to attachAds (clock). With a stitched plan the module never requests or schedules video cuts, and without clock it stays inactive. It draws nothing while an ad is on screen. The native adapters (Android, Apple, Roku, AVPlay) are not covered. See Server-side insertion to turn it on in the console and for the code to add.

Native apps

An Android, iOS, tvOS, Roku or Samsung Tizen app can show IL ads in two ways: If your app already requests its breaks from the per-break API, use the second way. If you have no ad pipeline of your own, the first is the shortest.

The SDK requests the plan

  1. In Settings → General → My own player, choose the app’s player and register its identifier in the field next to it (Register): the Android package name, the Apple bundle id, the Roku channel number (dev for a sideloaded channel), or the Tizen application id (tizen:<id>). Up to 20 apps per project.
  2. Call load (Android or Apple), loadPlan (Roku) or attachAvPlayAppAds (Samsung Tizen). The SDK requests GET https://console.interactivelayers.com/il-player/app-plan?project=<project_id>&asset=<asset_id>&app=<platform>:<id>, attaches the plan and draws the breaks, graphics and product.
The route follows the same rules as the web plan: 200 with the plan, 204 when there is no plan yet or a limit was reached (the view plays without ads and the next one asks again), and the same 404 for an unknown project, video or unregistered app: check the registration first. It answers without CORS, so a web page cannot read it. The app identifier protects against hotlinking just as Origin does on the web; it is not authentication.
  • Events. Without a plan, the SDK emits plan_unavailable once with the reason (http_204, http_404, timeout, network, stitched…) and the app= value it sent, and the content starts anyway. No event exposes the grant or the commerce URLs.
  • Short-lived plans. A version: 2 plan expires after 120 s. The SDK requests it again before expires_at with the same shopping session, so per-session caps and Buy keep working. It tries up to three times, 20, 12 and 5 s before expiry, and emits plan_renewed, or plan_renew_failed once if all three fail; on expiry, plan_expired, and the content continues without IL ads.
  • App identity in Google Ad Manager. An app’s plan has no page URL. The Android and Apple SDKs add msid and an to the Google Ad Manager requests they make themselves, and IMA adds the app identity on its own. The Roku SDK adds nothing: if your agreement with Google requires it, the project’s tags must already carry it. The Samsung SDK does not derive msid from the Tizen id: pass appParams: { msid, an }.
  • Server-side insertion. For a project with server-side insertion the route answers the plan with timeline, which the native SDKs still refuse (stitched): the app plays without IL ads or graphics.

Your app plays its breaks

Your backend creates the playback with "graphics": true, reads GET /v1/vod/playbacks/{playback_id}/plan and passes it to the app, which gives it to the SDK. The app reports its breaks and ads with setBreaks, breakStarted, adStarted, adEnded and breakEnded (on Samsung Tizen and the web, setBreakAd and clearBreakAd instead of adStarted and adEnded), and the SDK draws the scenes around them and Buy during an iADServer ad. The app must:
  • report every break and every ad; without reports, the SDK does not know an ad is on screen and may draw over it;
  • attach the SDK with the plan’s commerce.session as the session; with another one there is no Buy during breaks;
  • fetch ad_tag_url exactly as given, without touching sid or correlator.
The full contract and a sample response are in Graphics and Buy next to your app’s breaks.

Platform limits

  • The Overlay 300×250 is not available on Android TV, Fire TV, tvOS or Roku: Google does not offer its display SDK there (Fire TV by inference).
  • The banner designed in iADServer is not drawn on Android, iOS, tvOS or Roku: those apps show the product card.
  • On Apple and Roku, the Buy panel during an ad closes when the ad ends, even if the viewer opened it.
  • Samsung Tizen: the app route answers without CORS and it is not confirmed that a packaged app can read it. If the TV refuses it, request the plan from your backend and pass it to the SDK.
  • Roku: the ADS 1.1 requirement covers banners that are not Roku’s. Before publishing the channel, declare the SDK to Roku; Roku may reject it.

What was tested

None of this has run on a physical device yet.
  • Android. Unit tests, and instrumented tests on an Android 15 phone emulator and an Android 14 Android TV emulator, without real Google Ad Manager, IMA or iADServer ads in the latest round. Fire TV is treated as Android TV by inference, untested.
  • iOS and tvOS. Package tests on Mac Catalyst and on the iPhone 17 and Apple TV 4K simulators, and an example app on those simulators with a simulated ad: a local clip served by a local stand-in for the ad server. No real Google Ad Manager, IMA or iADServer ad was played.
  • Roku. Tests in the desktop interpreter, with a network double and a frozen clock. The real Roku Advertising Framework, HLS playback, HTTPS download and on-screen composition are pending a test on a Roku. Publishing the channel requires Roku’s ADS 1.1 review.
  • Samsung Tizen. Only in Node, with stand-ins for AVPlay. Nothing ran on a TV or a TV emulator, and the Tizen example app was never run.
  • Buy during a per-break API break. Verified against a real iADServer in automated contract tests, not with a real app.
Media3 and ExoPlayer · AVPlayer · Roku SceneGraph · Samsung Tizen and AVPlay

Optional Shopify product offers

Enable commerce on the session feed using commerce=1, locale and, when needed, country. The integration receives product and variant information plus the provider’s cart handoff URL. The player posts {"variantId":"42"} to that URL. It uses the response’s continueUrl on web or mobile and qrImageUrl on TV. iADServer manages the commercial offer and attribution, and Shopify hosts checkout. For a linked midroll, carry the VAST creative and delivery IDs from the iADServerShop extension into the player’s active linear-ad state. VAST owns that spot’s impression. SDK session contract and commerce options

Typeface of the product panels

The product panels (the Smart TV shop and the player card) are drawn in Montserrat, and the SDK includes it. The device does not need the typeface installed, and nothing is requested from Google or any third party. Montserrat is by The Montserrat.Git Project Authors and is released under the SIL Open Font License 1.1. Android. The library includes the font and the app adds nothing. The TV and phone panels use it from Android 8.0 (API 26); on earlier versions, or if the device cannot use it, they use the system font. The AAR grows from about 150 KB to about 452 KB. The licence file travels in the AAR with the font. Web. player.css imports fonts.css, which declares the font under the name IL Montserrat and points to fonts/Montserrat-wght.woff2 next to it: one variable file of 216 KB for all weights. Load fonts.css in the document, not inside a shadow root: browsers ignore the rule there and the panels use the fallback font. The browser downloads the font the first time a product appears on screen, and until it arrives the panel uses a fallback font (the page’s own Montserrat if it has one, otherwise Inter or the system font).
  • If you link the stylesheet from HTML, publish fonts.css and the fonts/ folder together with player.css. If you link only tv-shop.css, link fonts.css as well. Without the font file the panels use the fallback font.
  • With a bundler, import player.css as usual: the bundler picks the font up through the stylesheet’s url(). Some bundlers inline it into the CSS, which makes the stylesheet about 290 KB larger.
  • If the file is served from another origin, such as a CDN, that origin must send Access-Control-Allow-Origin. A page with a CSP font-src must allow that origin.
  • To deliver the font another way, leave fonts.css out and declare IL Montserrat yourself in the document, with weights 500, 600, 650 and 700.
  • Browsers without variable fonts (before Chrome 62, Firefox 62 or Safari 11) use the fallback font.
  • If you redistribute the fonts/ folder, keep OFL.txt next to the font.

Verify a known stream

From the SDK checkout, run this with Node.js and FFmpeg, then serve the output at the matching HTTPS URL. Open the resulting il.m3u8.
Watch for the lower third at 0:03–0:07 and the L at 0:10–0:15. Check continuous audio, layout restoration, seeks, pauses, and suppression during a confirmed linear spot. The built-in fixture has no commercial trackers. For measurement tests, add your own HTTPS impression collector and confirm one receipt per visible cue and zero for a skipped cue. Integration recipes · Platform verification