VAST examples / Media files
A <MediaFile> with no type attribute
VAST 2.01 error1 warningVAST-2.0-mediafile-type
The scenario
A connected-TV app's player team was investigating why one demand source's ads played on Android TV but not on certain smart-TV models. The creative was a standard MP4 pre-roll delivered progressively.
The broken tag
<?xml version="1.0" encoding="UTF-8"?>
<!-- ERROR: VAST-2.0-mediafile-type — <MediaFile> missing required type attribute -->
<VAST version="2.0">
<Ad id="ad-001">
<InLine>
<AdSystem>Test</AdSystem>
<AdTitle>Test Ad</AdTitle>
<Impression><![CDATA[https://track.example.com/impression]]></Impression>
<Creatives>
<Creative>
<Linear>
<Duration>00:00:30</Duration>
<MediaFiles>
<MediaFile delivery="progressive" width="1920" height="1080">
<![CDATA[https://cdn.example.com/video.mp4]]>
</MediaFile>
</MediaFiles>
</Linear>
</Creative>
</Creatives>
</InLine>
</Ad>
</VAST>What the validator reports
Running this tag through vastlint produces the following. The primary failure for this example:
VAST-2.0-mediafile-typeIAB VAST 2.0 §2.3.5.2line 14<MediaFile> is missing required type attribute
The same tag also surfaces these secondary findings — real tags rarely fail in isolation:
VAST-2.0-linear-tracking-quartilesIAB VAST 4.1 §3.14.2line 11<Linear> has no standard quartile tracking events (start/firstQuartile/midpoint/thirdQuartile/complete) — ad will serve but measurement system receives no signal
Why it breaks
The <MediaFile> carries a URL, width, height, and delivery, but no type attribute. The type holds the MIME type (for example video/mp4) and is required — players use it to decide, before fetching, whether their decoder supports the file. Without it, a permissive player may sniff the URL extension and still play, while a strict CTV player that selects strictly on declared type will skip the file as uncategorizable.
What it costs
The result is device-fragmented delivery: the ad renders on lenient players and silently fails on strict ones, so the same line item shows wildly different completion rates by device. On CTV, where strict selection is common, a missing type can knock out an entire class of high-value inventory without any obvious error.
The fix
Add the type attribute with the file's MIME type to every <MediaFile>. Provide a small set of renditions covering the codecs your target devices require (commonly video/mp4 plus an HLS/DASH manifest type for CTV).
<MediaFile delivery="progressive" type="video/mp4"
width="1920" height="1080">
<![CDATA[https://cdn.example.com/ad-1080.mp4]]>
</MediaFile>VAST XML fragment only. This excerpt belongs inside a complete VAST document, so standalone validation will fail until it is wrapped in a full <VAST>response.
Check your own version of this tag
Paste the resolved XML to run the same spec check, test a live tag URL, or inspect the wrapper chain hop by hop.
Related examples
- A <MediaFile> missing width and height — VAST-2.0-mediafile-dimensions
- A VAST 4.1 <Mezzanine> missing its required attributes — VAST-4.1-mezzanine-delivery
- An InLine ad with no <Impression> element — VAST-2.0-inline-impression
- An InLine ad missing the <AdSystem> element — VAST-2.0-inline-adsystem