Provide a FieldType and FieldWidget to represent a WebVTT file for the HTML track element

Created on 23 May 2019, about 5 years ago
Updated 10 June 2024, 18 days ago

Problem/Motivation

This task is part of the audio/video accessibility plan - 🌱 Provide authors with tools to manage transcripts and captions/subtitles for local video and audio Active .

We want to provide authors with the ability to upload WebVTT <track> files with subtitle, caption, and audio description, to supplement HTML <video> and <audio> elements.

Proposed resolution

  1. Provide a FieldType and FieldWidget plugin to represent a WebVTT file.
  2. Support all of the attributes of the HTML <track> element. Authors should be able to set kind, label, src, srclang, default. Browsers currently only support captions and subtitles, but some JS player libraries support audio descriptions and chapters tracks too (notably AblePlayer).
  3. The field type config can allow site builders to limit the values of the kind attribute which a given MediaTrackItem can accept.
  4. Rendering the track element is out of scope for this issue. FieldFormatter will be done in another task issue.

Challenges

Validation: the default attribute has a peculiar usage. It says which track is to be considered the default track to use, but this means the default track for each possible value of the kind attribute. For example, a <video> could have chapters, audio description, subtitles, and captions tracks, in 3 languages. There could be up to 4 default <track> elements in this case. Validating this could be tricky for the UI. Decide if validation is required/feasible for the <track default> attribute. We might just trust authors to use it correctly.

Remaining tasks

  1. Use a select element for the srclang in the FieldWidget plugin.
  2. Add some configuration options in the FieldType plugin, so that site builders can specify which values of the kind attribute to accept.
  3. Decide if validation is required/feasible for the <track default> attribute.
  4. Implement generateSpecimenValue. The patch has some pseudocode already.
  5. Tests.

User interface changes

Adds new FieldType and FieldWidget plugins to represent a HTML <track> element.

API changes

None.

Data model changes

Adds a new FieldType plugin to represent a HTML <track> element.

πŸ“Œ Task
Status

Needs work

Version

11.0 πŸ”₯

Component
File systemΒ  β†’

Last updated about 13 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.

  • πŸ‡¬πŸ‡§United Kingdom jonathanshaw Stroud, UK

    Improvements in deep learning have led to the advent of automatic speech recognition tools like OpenAI's whisper that have dramatically improved speect-to-text capability. Therefore I'm doubtful that this issue is correct to expect uploaded webvtt files to be the most common use case in the future. The webvtt data may well be coming from a cloud API call of some kind, not an upload in the UI, and therefore a text field may be better than a file field.

  • πŸ‡©πŸ‡ͺGermany djanik

    I removed the patches for deprecated themes from patchfile in order to use it with drupal 10.1. so stable9 is the only core theme that gets patched.
    As long as there is no better option it still does it's duty in drupal 10.

  • πŸ‡³πŸ‡ΏNew Zealand jonathan_hunt

    @djanik Thanks for the patch. FWIW it applies to Drupal 10.2.7.

Production build 0.69.0 2024