--- import type { CollectionEntry } from 'astro:content'; import { Picture } from 'astro:assets'; type MediaItem = CollectionEntry<'posts'>['data']['media'][number]; interface Props { item: MediaItem; } const { item } = Astro.props; const videoWidth = item.type === 'video' ? (item.poster?.width ?? 1280) : undefined; const videoHeight = item.type === 'video' ? (item.poster?.height ?? 720) : undefined; ---
{ item.type === 'video' ? ( // Decorative videos stay inert and hidden from assistive tech. Meaningful // videos expose controls, captions, and an accessible name. item.decorative ? ( ) : ( ) ) : ( item.src && ( ) ) } {item.caption && !item.decorative &&
{item.caption}
} { item.transcript && (

Transcript: {item.transcript}

) }