Skip to content
Calm motion: animations on this site only fade, with no movement

Transcript ​

Lines of text that follow the time of the media

Shows the words of an episode or a video, line by line. The current line follows the time of the media, and a click on the time of a line plays from there. For the chapters of an episode, use the chapter list.

Basic
0:00
  1. Ana

    Welcome back to Home Studio, episode forty-one.
  2. Today we talk about sound on a small budget.
  3. With me is Budi, who records a show from his bedroom.
  4. Budi

    Thanks for having me. It is a very small bedroom.
  5. Ana

    So what did you buy first?
  6. Budi

    Nothing! I moved my desk next to the wardrobe.
  7. The clothes stop the echo better than foam panels.
  8. Ana

    That is the cheapest tip of the year.
  9. Budi

    Then a USB microphone, and a pop filter from a sock.
  10. Ana

    We will put the links in the show notes.
  • cues is a list of lines. Each line has a start in seconds, the text, an optional speaker, and an optional end. With no end, a line lasts until the next line starts.
  • time is the time of the media now, in seconds. Set it from the timeupdate event of an audio or video element.
  • A click on the time of a line emits seek with its start. Set the currentTime of your media to it.
  • The current line has a bar, a background, and bold words. Earlier lines are gray. If the speaker changes, the name of the new speaker shows.
  • With follow (on by default), the box scrolls to keep the current line in the middle. Only the box scrolls, never the page. Set the height of the box with the --bless-transcript-height CSS variable (default 20rem).
  • The box is a region that the keyboard can scroll. The current line has aria-current="time". Change the words with labels or a label pack: title, and seek (a function of the time).

Usage ​

ts
import { BlessTranscript } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
cues*BlessCue[]—
timenumber0the time of the media now, in seconds
followbooleantruekeep the current line in view while the media plays
labelsPartial<{ title: string; seek: (time: string) => string; }>—

Events

NamePayloadDescription
seek[seconds: number]

Released under the MIT License. Character names and artwork belong to their owners.