While testing various dates, I noticed a big bug: the APOD API doesn’t just return images. On some days, they post YouTube video streams or interactive space maps. Trying to render a video inside an tag broke the site. I wrote a helper function buildMediaHTML(data) to inspect media_type. If it’s a video, it parses the YouTube ID and loads it inside a clean, autoplaying, and muted container.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.