VAST 4.x Specification Support
The SDK implements the IAB VAST 4.x specification with TV-optimized behaviors:- InLine Ads: Direct linear video ads with complete creative data
- Wrapper Ads: Nested VAST documents with configurable depth limits
- Linear Creatives: Video ads with duration, skip offset, media files, and tracking
- Tracking Events: Full event lifecycle from impression to completion
- Error Handling: VAST error codes with automatic fallback mechanisms
VAST 4.x is the industry standard for video ad serving. Adgent SDK focuses on the linear video subset most relevant to TV platforms.
Wrapper Resolution
VAST wrappers allow ad servers to chain multiple VAST documents together. Adgent SDK resolves these chains with configurable depth limits to prevent infinite loops.Maximum Wrapper Depth
The default maximum wrapper depth is 5 levels (configurable viamaxWrapperDepth):
src/core/VASTParser.ts:49 and src/core/VASTParser.ts:91-94
Wrapper Merging Logic
When resolving wrappers, the parser merges tracking events from all levels:src/core/VASTParser.ts:150-174
Fallback Behavior
If a wrapper fails to resolve, the SDK checks thefallbackOnNoAd attribute:
fallbackOnNoAd="true": Returns empty ad array (graceful degradation)fallbackOnNoAd="false": Throws error and triggers error callbacks
src/core/VASTParser.ts:142-146
Media File Selection Algorithm
Adgent SDK uses an intelligent algorithm to select the best media file for Smart TV playback. The selection prioritizes compatibility over quality to prevent playback failures on older hardware.Selection Priority
- VPAID Filtering: Explicitly excludes VPAID/JavaScript media files
- Video-only: Only
video/*MIME types are considered - MP4 Preference: Prioritizes
video/mp4for maximum compatibility - 4K Penalty: Penalizes resolutions above 1080p (height > 1080)
- Bitrate Matching: Selects closest to
targetBitrate(default: 2500 kbps)
Implementation
src/core/VASTParser.ts:441-479
Why Penalize 4K?
Smart TVs, especially models from 2016-2019, have limited memory and processing power. 4K ads can cause:- UI stuttering during playback
- Memory exhaustion leading to crashes
- Excessive bandwidth consumption on WiFi
- Buffer underruns on slower connections
Tracking Events
The SDK fires all standard VAST tracking events at the appropriate times during ad playback:Supported Events
| Event | Description | When Fired |
|---|---|---|
impression | Ad impression (visibility) | When ad starts loading |
start | Playback started | When video begins playing |
creativeView | Creative became viewable | When video begins playing |
firstQuartile | 25% progress | At 25% of duration |
midpoint | 50% progress | At 50% of duration |
thirdQuartile | 75% progress | At 75% of duration |
complete | Ad finished | When video ends naturally |
skip | User skipped ad | When skip button is clicked |
pause | Playback paused | When user pauses |
resume | Playback resumed | When playback resumes |
mute | Audio muted | When user mutes |
unmute | Audio unmuted | When user unmutes |
error | Playback error | On any error condition |
Quartile Tracking
Quartile events are fired once per session using a Set to track which quartiles have been fired:src/core/AdPlayer.ts:486-501
Error Tracking
VAST errors include standard error codes from the specification:[ERRORCODE] macro replacement.
What’s NOT Supported
VPAID Explicitly Excluded
Adgent SDK does not support VPAID (Video Player-Ad Interface Definition). VPAID media files are automatically filtered out during media selection.Why No VPAID?
VPAID is deliberately excluded for Smart TV platforms due to:- Performance: VPAID requires executing arbitrary JavaScript within the player context, which severely degrades performance on resource-constrained TV hardware
- Stability: Third-party VPAID scripts are a common source of memory leaks and application crashes on long-running TV apps
- Security: Executing unverified external code poses significant security risks
- Modern Alternatives: The industry has moved towards VAST 4.x and OMID for measurement, rendering VPAID obsolete
src/core/VASTParser.ts:447-452 and README.md:372-382
Non-Linear & Companion Ads
The SDK focuses exclusively on linear video ads. Non-linear (overlay) and companion (banner) ads are not parsed or displayed. This design decision reflects the TV use case where full-screen linear video is the primary ad format.Advanced Features
The following VAST 4.x features are not currently supported:- Interactive creatives (requires VPAID)
- Ad pods with complex sequencing
- Conditional ads
- Verification resources (OMID/OM SDK)
- Industry icons
- Ad parameters for custom data passing
If you need advanced features like OMID verification or ad pods, please contact [email protected] to discuss custom implementations.
Configuration
VAST parser behavior can be customized via the SDK configuration:Related
Platform Support
Learn about platform detection and capabilities
Nuclear Mute Strategy
Understand the autoplay strategy for Smart TVs
