Appearance
Integration Flow
An Android integration is split between Infillion and the publisher. Infillion provides the VAST tag and renders the interactive ad. The publisher's app finds the Infillion ad in its ad break, hands it to TruexAdRenderer, and moves the playback timeline forward when the renderer is done.
Infillion provides a test VAST tag
Your Infillion contact provides a test VAST tag that fits your ad setup. The generic tag is the preferred option. The companion tag is used when it works better with your ad stack, for example with Google IMA DAI. Both formats are described in VAST Tag Types.
The publisher traffics the tag
Your ad ops team schedules the tag in your ad server. A TrueX tag must be the first ad in the pod. An IDVx tag can be placed in any slot.
The publisher integrates the SDK
Your app resolves
adParametersfrom the ad, starts the renderer when the ad plays, and handles the terminal events.
Resolving adParameters
The renderer is initialized with an adParameters JSONObject. Where that JSON comes from depends on the VAST tag format and the ad framework your app uses:
| Tag format | Where adParameters is in the VAST | Google IMA (CSAI and DAI) | Custom VAST parsing |
|---|---|---|---|
| Generic | <Linear><AdParameters> as a JSON string | ad.traffickingParameters | Text content of <AdParameters> |
| Companion | <Companion apiFramework="truex"><StaticResource creativeType="application/json"> as a base64 JSON data: URL | ad.companionAds (apiFramework is truex) | Text content of <StaticResource>, base64-decoded after the comma |
To support both formats, resolve the payload in this order:
- Look for a companion with
apiFramework="truex"and decode its JSON. - If there is none, parse the
<AdParameters>JSON. - If neither one gives valid JSON, do not start the renderer. Treat the ad as a normal linear ad and continue the pod.
Before resolving the payload, identify the ad by its <AdSystem> value (ad.adSystem in Google IMA). trueX is a TrueX ad and IDVx is an IDVx ad; any other value is a regular linear ad. A TrueX ad that is not the first ad in the pod should play as a regular linear ad.
The TV examples contain complete resolvers for Google IMA and for custom VAST parsing.
Starting the Renderer
When the Infillion ad starts playing:
- Pause the ad playback (for Google IMA, pause the
AdsManageror the stream) and hide the video player. - Create a
TruexAdRenderer, add your event listener, and callinitwith theadParametersJSON. - Call
startwith the full-screenViewGroupabove your player. - Wait for a terminal event. While you wait, keep track of whether
AD_FREE_PODhas fired.
The calls are described in SDK Integration.
Handling Terminal Events
A terminal event means the renderer is done, and your app must move the playback timeline forward. What "forward" means depends on whether the user earned the ad-free pod reward and on how your ads are inserted:
| Renderer result | What to do | CSAI (e.g. Google IMA) | SSAI (e.g. Google IMA DAI) |
|---|---|---|---|
AD_COMPLETED after AD_FREE_POD | Skip all remaining ads in the pod and continue the content | Discard the ad break (adsManager.discardAdBreak()) | Seek to the ad break start plus the break duration |
AD_COMPLETED without AD_FREE_POD | Skip the Infillion placeholder ad and play the next ad in the pod | Finish the placeholder ad and resume the ad manager | Seek to the end of the placeholder ad |
AD_ERROR or NO_ADS_AVAILABLE | Same as AD_COMPLETED without AD_FREE_POD | Same | Same |
USER_CANCEL_STREAM | The user pressed Back during the Infillion ad - exit the playback screen | Close the player | Close the player |
AD_COMPLETED without AD_FREE_POD covers a TrueX user who opted out or let the choice card time out, and it is the normal outcome of every IDVx ad, because IDVx never fires AD_FREE_POD.
IMPORTANT
Do not seek or resume playback when AD_FREE_POD fires. Remember that it fired, and act only on the terminal event that follows.
After any terminal event, remove your listeners, call stop(), and drop all references to the renderer instance. The full list of terminal events is on the Events page.

