Add responsive video option to field formatter

Created on 27 July 2022, over 2 years ago
Updated 25 February 2023, about 2 years ago

The patch to follow adds a new setting to the field formatter "Use responsive video?" which when checked adds a wrapper around the media iframe. It uses the width setting as a maximum, then uses the standard padding-bottom: 56.25%; method to make the video responsive. If the new box is checked, it will ignore the height set (and this is noted in the field description). If the box is not checked, the markup doesn't change.

πŸ“Œ Task
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany seanpb

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States rhovland Oregon

    This works well for when the viewport isn't wide enough for the video (to prevent side to side scrolling) but if the viewport isn't tall enough but wide enough then you have vertical scrolling.

  • πŸ‡ΊπŸ‡ΈUnited States rhovland Oregon

    Here's a patch that fixes the height issue. Some extra overflow becomes visible when the viewport is smaller than the box generated for it by colorbox. It seems to be a bug with the main colorbox module/script but I haven't identified how to fix it yet.

Production build 0.71.5 2024