planetary-social/nos

[Media Display] Change aspect ratio to 3:4 for vertical media

Closed this issue · 1 comments

All horizontal or square media will be displayed in a 4:3 horizontal aspect ratio, but vertical media should be displayed at 3:4 when it is by itself. In a gallery the orientation of the first item will set the the aspect ratio to 3:4 or 4:3 for all items in the gallery.

This partially fulfills the following stories:

  • All horizontal media will have a 4:3 ratio
  • All vertical media with a 3:4 ratio
  • Carousel media display follows the first item

For now, all videos will default to 3:4 ratio until we implement #1425. Horizontal and vertical images will appear in the correct aspect ratio according to the stories.

@setch-l as with our other new media display work, this is behind the feature flag toggle in Settings > Enable new media display. Here are my suggested testing steps:

  1. Navigate to Settings
  2. Toggle "Enable new media display" to on
  3. Go back to the feed, or a profile, or a thread and observe or create posts with multiple links.
  4. When a portrait image is the first link in a post, the gallery appears in portrait (3:4) orientation.
  5. When a landscape image is the first link in a post, the gallery appears in landscape (4:3) orientation.
  6. Find or create a post with a single portrait image
  7. Verify that it's displayed in 3:4 aspect ratio
  8. Find or create a post with a single landscape image
  9. Verify that it's displayed in 4:3 aspect ratio

As we discussed, videos will all be shown in 3:4 (vertical) for now and until #1425 is complete.