videogen/apps/web/lib/seo/free-tools/app-preview-specs.ts
caelum0x d56639a594
Some checks failed
build-images / web (push) Has been cancelled
vision2026-ci / Python SDK resource tests (push) Has been cancelled
build-images / api (push) Has been cancelled
build-images / worker-gpu (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Has been cancelled
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Has been cancelled
codeql / Analyze (javascript-typescript) (push) Has been cancelled
codeql / Analyze (python) (push) Has been cancelled
perf / API hot-path micro-smoke (budgeted) (push) Has been cancelled
perf / Desktop engine crates (release build check) (push) Has been cancelled
vision2026-ci / API phase modules (ruff + pytest) (push) Has been cancelled
vision2026-ci / Alembic upgrade + drift check (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Has been cancelled
Menivor — open source release (MIT), free to use and fork
Paid, hosted product at menivor.com, now retired as a company project.
Fresh squashed history of the cleaned working tree (secret-scanned,
no .env, no customer data, no outreach logs). Built on
MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
2026-12-04 02:10:26 +03:00

111 lines
5.2 KiB
TypeScript

/**
* Real App Store "app preview" video and Google Play promo-asset specs,
* behind the free spec checker at `/tools/app-store-preview-video-size-checker`.
*
* Sourced from Apple's and Google's own current docs, checked 2026-11-17:
* - Apple: https://developer.apple.com/help/app-store-connect/reference/app-preview-specifications/
* - Google: https://support.google.com/googleplay/android-developer/answer/9866151
* No number here is invented or estimated; anything not confirmed on those
* pages (e.g. exact bitrate for every device category) is left out rather
* than guessed.
*/
export interface AppPreviewResolution {
readonly width: number;
readonly height: number;
}
export interface AppPreviewDevice {
readonly key: string;
/** Device/display label as Apple's own reference table names it. */
readonly label: string;
readonly portrait: AppPreviewResolution | null;
readonly landscape: AppPreviewResolution | null;
}
/** Apple's accepted App Preview upload resolutions, by device/display category. */
export const APP_PREVIEW_DEVICES: readonly AppPreviewDevice[] = [
{ key: "iphone-dynamic-island", label: "iPhone, Dynamic Island display", portrait: { width: 886, height: 1920 }, landscape: { width: 1920, height: 886 } },
{ key: "iphone-face-id", label: "iPhone, Face ID display", portrait: { width: 886, height: 1920 }, landscape: { width: 1920, height: 886 } },
{ key: "iphone-home-button-large", label: "iPhone, Home Button display (large)", portrait: { width: 1080, height: 1920 }, landscape: { width: 1920, height: 1080 } },
{ key: "iphone-home-button-medium", label: "iPhone, Home Button display (medium)", portrait: { width: 750, height: 1334 }, landscape: { width: 1334, height: 750 } },
{ key: "iphone-home-button-4in", label: "iPhone, Home Button display (4\")", portrait: { width: 1080, height: 1920 }, landscape: { width: 1920, height: 1080 } },
{ key: "ipad-13in", label: "iPad, 13\" display", portrait: { width: 1200, height: 1600 }, landscape: { width: 1600, height: 1200 } },
{ key: "ipad-11in", label: "iPad, 11\" display", portrait: { width: 1200, height: 1600 }, landscape: { width: 1600, height: 1200 } },
{ key: "ipad-10-5in", label: "iPad, 10.5\" display", portrait: { width: 1200, height: 1600 }, landscape: { width: 1600, height: 1200 } },
{ key: "ipad-9-7in", label: "iPad, 9.7\" display", portrait: { width: 900, height: 1200 }, landscape: { width: 1200, height: 900 } },
{ key: "mac", label: "Mac (landscape only)", portrait: null, landscape: { width: 1920, height: 1080 } },
{ key: "apple-tv", label: "Apple TV (landscape only)", portrait: null, landscape: { width: 1920, height: 1080 } },
{ key: "vision-pro", label: "Apple Vision Pro (landscape only)", portrait: null, landscape: { width: 3840, height: 2160 } },
];
/** Apple App Preview duration, file-size and count limits. */
export const APP_PREVIEW_LIMITS = {
minDurationSec: 15,
maxDurationSec: 30,
maxFileSizeMB: 500,
maxPerLanguage: 3,
defaultPosterFrameSec: 5,
maxFrameRate: 30,
formats: [".mov", ".m4v", ".mp4 (H.264)", ".mov only (ProRes 422 HQ)"],
h264BitrateMbps: { min: 10, max: 12 },
} as const;
/** Google Play's feature graphic (the image a promo video's play button sits on). */
export const GOOGLE_PLAY_FEATURE_GRAPHIC = {
width: 1024,
height: 500,
format: "JPEG or 24-bit PNG, no alpha channel",
} as const;
/** Google Play's promo video rules (hosted on YouTube, not a direct upload). */
export const GOOGLE_PLAY_PROMO_VIDEO = {
hosting: "A YouTube video URL (not a playlist or channel URL)",
autoplaySec: 30,
requirements: [
"Public or unlisted privacy setting (not private)",
"Not age-restricted",
"Embedding allowed",
"Ads disabled on the video",
],
} as const;
/** Find the device entry a key maps to, or undefined. */
export function findAppPreviewDevice(key: string): AppPreviewDevice | undefined {
return APP_PREVIEW_DEVICES.find((device) => device.key === key);
}
export interface AppPreviewMatch {
readonly device: AppPreviewDevice;
readonly orientation: "portrait" | "landscape";
}
/**
* Every accepted device/orientation an exact width x height matches. Apple
* only accepts these exact pixel sizes per category (no "close enough"), so
* this is an exact match, not a nearest-fit guess.
*/
export function matchingAppPreviewDevices(width: number, height: number): readonly AppPreviewMatch[] {
if (!(width > 0) || !(height > 0)) return [];
const matches: AppPreviewMatch[] = [];
for (const device of APP_PREVIEW_DEVICES) {
if (device.portrait && device.portrait.width === width && device.portrait.height === height) {
matches.push({ device, orientation: "portrait" });
}
if (device.landscape && device.landscape.width === width && device.landscape.height === height) {
matches.push({ device, orientation: "landscape" });
}
}
return matches;
}
/** Whether a duration in seconds satisfies Apple's App Preview min/max. */
export function durationInRange(durationSec: number): boolean {
return durationSec >= APP_PREVIEW_LIMITS.minDurationSec && durationSec <= APP_PREVIEW_LIMITS.maxDurationSec;
}
/** Whether a file size in MB is within Apple's App Preview max. */
export function fileSizeInRange(sizeMB: number): boolean {
return sizeMB > 0 && sizeMB <= APP_PREVIEW_LIMITS.maxFileSizeMB;
}