Skip to content

Template and styles for inline oembed videos #70

@alisonjo315

Description

@alisonjo315

We're switching from video_embed_field to Drupal core "oembed" functionality for YouTube videos:
https://github.com/CU-CommunityApps/cd_drupal_upstream/issues/42

Accompanying tasks for our Drupal base theme -- can happen any time (no need to wait for the cd_drupal_upstream issue to be complete):

  • Remove extra "div" wrapper from video embed field output:
    • Create field--field-media-oembed-video.html.twig -- simply to use _field--less-wrapped.html.twig (same as field--image.html.twig).
  • Configure view modes (on CLASSE and VPUE and CVM, we provided "default" and "medium sized") -- THEN, check text formats and make sure "video"/"remote video" is enabled, and the "default" and "medium" view modes are available.
    • In theory, can skip this on CD Demo, and just do it on sites that use this functionality -- they can copy the view mode and CKEditor settings CLASSE/VPUE.
    • Don't forget to make sure Media Library "advanced UI" is enabled: /admin/config/media/media-library
  • Add style rule to Drupal stylesheet, for inline video embeds:
iframe.media-oembed-content {
  display: block;
  width: 100%; 
  height: auto;
  aspect-ratio: 16 / 9;
}

FWIW: This work is already happening on VPUE (as of 2023-09-13, the oembed field template is done, the style rule will be done soon).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions