appStorePreviewRules top-level constant
Apple's app preview rules, from the App Store Connect help's preview specifications page.
https://developer.apple.com/help/app-store-connect/reference/app-preview-specifications/
Apple is the authority, not this table — the same caveat metadata.dart's screenshot sizes carry. The four values here are the ones Apple states as numbers and enforces at ingestion, so they are worth asserting; anything softer is left to Apple.
ProRes 422 HQ is listed because Apple lists it, not because anything here
has uploaded one. apch is 422 HQ specifically — apcn, apcs and apco
are the lower 422 variants and ap4h is 4444, and Apple's page says "HQ
only", so naming the one is the accurate reading of it rather than an
oversight.
The file size is the decimal reading of an ambiguous number, on purpose.
Apple's page says "500MB" and states no units, so 500,000,000 and
524,288,000 are both defensible. Decimal is taken for two reasons: Apple has
written user-facing storage sizes in decimal MB since 2009, so it is the
likelier reading; and the two errors are not symmetric. Refusing a file in
the 24 MB band between the readings costs a re-encode of something that
would probably have been accepted. Accepting one Apple then refuses costs a
day in the ingestion queue and a resubmission, which is the whole thing this
check exists to avoid. See _megabytes, which has to use the same base or
the message compares two numbers in different units.
Implementation
const appStorePreviewRules = VideoRules(
store: 'the App Store',
codecs: {'avc1': 'H.264', 'avc3': 'H.264', 'apch': 'ProRes 422 HQ'},
maxFrameRate: 30,
minDuration: Duration(seconds: 15),
maxDuration: Duration(seconds: 30),
maxFileSize: 500 * 1000 * 1000,
requiredAudioChannels: 2,
ambiguousMegabytes: true,
);