Cue Interactivity Demo

Compare auto (default), interactive: false, and interactive: true. This page shows when cues are bound, skipped, or upgraded for keyboard activation. Each section follows the same local media fixture from start to finish.

Back to foundations · Long-transcript toolkit · Resilience lab

Auto (default)

Only native interactive elements (buttons/links) will act as seek controls. Plain text cues remain readable and do not receive click handlers.

Transcript — Auto

  1. 00:04 Plain HTML keeps every transcript readable. (Plain text in auto mode.)
  2. 00:12 Activating a cue seeks without moving focus. (Plain text cue.)

  3. 00:20 Chapter buttons jump to meaningful sections. (Plain text in auto mode.)
  4. 00:28 You stay in control of scrolling and motion. (Plain text cue.)

Non-interactive (interactive: false)

All cues use non-interactive HTML and remain readable. The option does not remove native button semantics, so authors should not use buttons for cues that are intentionally non-interactive.

Transcript — Non-interactive

  1. 00:00 Welcome to the A11yTranscript demonstration.

  2. 00:04 Plain HTML keeps every transcript readable.
  3. 00:08 Playback highlights the cue for the current time.

  4. 00:12 Activating a cue seeks without moving focus.

  5. 00:16 Search finds words while keeping all cues visible.

  6. 00:20 Chapter buttons jump to meaningful sections.
  7. 00:24 Reader preferences can enlarge or simplify the text.

  8. 00:28 You stay in control of scrolling and motion.

Force interactive (interactive: true)

All cues are upgraded to be interactive: non-native elements receive role="button" and tabindex="0", and keyboard activation works (Enter/Space).

Transcript — Force interactive

  1. 00:04 Plain HTML keeps every transcript readable. (Upgraded div.)
  2. 00:12 Activating a cue seeks without moving focus. (Upgraded paragraph.)

  3. 00:20 Chapter buttons jump to meaningful sections. (Upgraded div.)
  4. 00:28 You stay in control of scrolling and motion. (Upgraded paragraph.)

Choose cue behavior

Use native buttons when a cue should seek. Choose an explicit interactivity mode only when the transcript needs a different rule.

HTML

<section
  class="a11y-transcript"
  data-media="#episode-video"
  data-sync
  aria-labelledby="transcript-title"
>
  <h2 id="transcript-title" class="a11y-transcript__title">Transcript</h2>
  <ol class="a11y-transcript__list">
    <li class="a11y-transcript__item">
      <!-- Native buttons work in the default interactive mode. -->
      <button class="a11y-transcript__cue" type="button" data-start="0">
        <span class="a11y-transcript__time">00:00</span>
        A cue that seeks the video.
      </button>
    </li>
    <li class="a11y-transcript__item">
      <p class="a11y-transcript__cue" data-start="8">
        A readable, non-interactive cue.
      </p>
    </li>
  </ol>
</section>

JavaScript

import { A11yTranscript } from "a11y-transcript";

function initializeTranscript(selector, options) {
  const root = document.querySelector(selector);
  if (root instanceof HTMLElement) new A11yTranscript(root, options);
}

initializeTranscript("#default-transcript");
initializeTranscript("#static-transcript", { interactive: false });

// Use this only when non-native cues must become keyboard controls.
initializeTranscript("#upgraded-transcript", {
  interactive: true
});