A tag can offer one rendition with the desired dimensions and another with a supported codec, while neither rendition meets the player's complete requirements. An incorrectly grouped validation check can combine their properties into a fictional playable file.
This is a logical error before it is a video problem. The question is whether one candidate satisfies all required predicates, not whether each predicate is satisfied somewhere in the list.
A useful selection report keeps each MediaFile intact, explains its failed conditions and distinguishes declared compatibility from observed decoding.
Write the destination policy explicitly
Start with a named player profile and the properties that matter for that deployment. They may include delivery type, container, codec, dimensions and bitrate. Preserve the profile version with the result.
Avoid a generic CTV-compatible boolean unless your application defines exactly which environment and requirements it represents. Different destinations can support different combinations, and a declaration that works on one player is not evidence about another.
The policy below is synthetic: minimum 1280 by 720, an application codec label of h264 and a positive bitrate no greater than 3000 kilobits per second. These are example thresholds, not universal VAST or CTV requirements.
The objects model already parsed and normalized declarations. They do not reproduce the full MediaFile schema.
Apply every predicate to the same candidate
Run this complete program with Node.js:
import assert from 'node:assert/strict';
const files = [
{ id: 'large-hevc', width: 1920, height: 1080, codec: 'hevc', bitrateKbps: 2500 },
{ id: 'small-h264', width: 640, height: 360, codec: 'h264', bitrateKbps: 700 }
];
const misleading = files.some(f => f.width >= 1280 && f.height >= 720) &&
files.some(f => f.codec === 'h264') &&
files.some(f => f.bitrateKbps > 0 && f.bitrateKbps <= 3000);
function failures(file) {
const issues = [];
if (!Number.isFinite(file.width) || !Number.isFinite(file.height) ||
file.width < 1280 || file.height < 720) issues.push('dimensions');
if (file.codec !== 'h264') issues.push('codec');
if (!Number.isFinite(file.bitrateKbps) ||
file.bitrateKbps <= 0 || file.bitrateKbps > 3000) issues.push('bitrate');
return issues;
}
assert.equal(misleading, true);
assert.deepEqual(files.filter(f => failures(f).length === 0), []);
assert.deepEqual(failures(files[0]), ['codec']);
assert.deepEqual(failures(files[1]), ['dimensions']);
const usableDeclaration = {
id: 'large-h264', width: 1280, height: 720,
codec: 'h264', bitrateKbps: 1800
};
assert.deepEqual(failures(usableDeclaration), []);
assert.deepEqual(failures({ ...usableDeclaration, bitrateKbps: undefined }),
['bitrate']);
assert.deepEqual(failures({ ...usableDeclaration, bitrateKbps: 3001 }),
['bitrate']);
The first expression returns true even though neither original candidate passes. The corrected filter keeps the predicates together and returns no eligible candidate until a suitable declaration is supplied.
The diagnostic function is useful beyond this test. It can explain why each candidate was excluded instead of returning one unexplained false result for the entire tag.
Make missing metadata visible
A missing bitrate is not a measured zero. A missing codec declaration is not evidence of your preferred codec. Decide whether incomplete metadata should reject the candidate, require probing or produce an unknown result under the selected profile.
Keep that policy separate from parsing. First establish what the document declares and whether its types are valid. Then apply destination-specific requirements.
Preserve units in normalized field names. The example uses bitrateKbps to avoid comparing a kilobit value with a threshold measured in bits per second. Similar mistakes can occur when a probe result and an XML declaration use different representations.
Test exact boundaries as well as obvious failures. A candidate at the minimum dimensions or maximum allowed bitrate should exercise the policy's intended inclusive or exclusive comparison.
Select a candidate before claiming playback support
Several candidates may satisfy the declaration policy. Define how the player or integration chooses among them and record which one it selected in the test run.
A deterministic test should retain that candidate's URL, declaration and content identity when available. Otherwise a later run might choose a different rendition and make a regression appear intermittent.
If selection uses estimated bandwidth or device capabilities, preserve those inputs too. A selection algorithm cannot be reproduced from the MediaFile list alone when its other inputs change between runs.
Do not assume the highest resolution is always the intended choice. Use the destination's real selection rules and the network conditions relevant to the test.
Verify the resource behind the declaration
A declared MIME type, codec or dimension is an input to selection. It is not a probe of the media bytes returned by the URL.
After selecting a candidate, check the retrieval result and inspect the actual container, codec, dimensions and other properties required by your acceptance plan. Record when the resource was fetched because the content behind a stable URL can change.
Then exercise the selected rendition on the destination player. A resource can be retrievable and structurally consistent while decoding still fails in a specific runtime.
Keep declared, probed and observed values separate in the report. If the probe disagrees with the declaration, show that disagreement rather than replacing the declaration with the probe value and losing evidence of the original problem.
Give the creative team a specific repair
When no candidate qualifies, provide one row per candidate with the failed predicates. The report should make it clear whether a missing rendition would close the gap or whether all files share a common defect.
For the synthetic example, the team can see that the large file fails the codec requirement while the supported-codec file fails the dimensions requirement. That is more actionable than a message saying the tag has no playable media.
After a replacement is supplied, rerun the same profile and preserve the newly selected candidate. Also repeat the runtime test if the acceptance claim includes playback.
I maintain VASTlint. The VAST tester helps inspect the tag and its media choices. Keep your destination policy and selected-rendition observation with that result so every compatibility claim refers to one actual candidate.
Sources
Technical sources checked October 25, 2026. Drafted with AI; examples are synthetic unless explicitly stated otherwise.
Top comments (0)