Update audio and video file field formatters to include track elements

Created on 26 May 2019, about 5 years ago
Updated 20 January 2023, over 1 year ago

Problem/Motivation

Part of the audio/video accessibility plan - 🌱 Provide authors with tools to manage transcripts and captions/subtitles for local video and audio Active

Prerequisite: πŸ“Œ Provide a FieldType and FieldWidget to represent a WebVTT file for the HTML track element Needs work . That issue provides the data model and authoring UI to upload WebVTT track files to accompany audio/video elements.

This issue is about rendering the track elements in the HTML output of fields.

Proposed resolution

  • Add a new setting to the video field formatter. Site builders can specify a field containing tracks relating to this video field.
  • Pass the track file information to the video field template. Support all the attributes of the <track> element.
  • Render the track elements inside the video element.
  • I expect the markup changes can qualify for Stable and Classy backwards compatibility policy, because:
    • We're addressing a WCAG level-A failure, and
    • Existing sites which don't have the caption field yet, the HTML track element just doesn't need to be rendered at all.
  • Provide the same functionality to the audio file field formatter. Much code can be shared in FileMediaFormatterBase.

Remaining tasks

  • Improve the video formatter setting which species the track field. Show a select for qualifying fields (i.e Media Track fields) so users can't choose the wrong type of field, and avoid mistakes in typing the maching name.
  • Add the same functionality to the audio file field formatter
  • Update config schema for media file formatters?
  • Tests for new functionality.
  • ... anything else?

User interface changes

Adds a new setting to the video field formatter, so site builders can specify whether to include track elements from another field.

API changes

None.

Data model changes

Adds a configuration option to the video field formatter.

πŸ“Œ Task
Status

Needs work

Version

10.1 ✨

Component
File systemΒ  β†’

Last updated about 22 hours ago

Created by

πŸ‡¬πŸ‡§United Kingdom andrewmacpherson

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

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.

No activities found.

Production build 0.69.0 2024