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
Ana
Welcome back to Home Studio, episode forty-one.- Today we talk about sound on a small budget.
- With me is Budi, who records a show from his bedroom.
Budi
Thanks for having me. It is a very small bedroom.Ana
So what did you buy first?Budi
Nothing! I moved my desk next to the wardrobe.- The clothes stop the echo better than foam panels.
Ana
That is the cheapest tip of the year.Budi
Then a USB microphone, and a pop filter from a sock.Ana
We will put the links in the show notes.
cuesis a list of lines. Each line has astartin seconds, thetext, an optionalspeaker, and an optionalend. With noend, a line lasts until the next line starts.timeis the time of the media now, in seconds. Set it from thetimeupdateevent of anaudioorvideoelement.- A click on the time of a line emits
seekwith its start. Set thecurrentTimeof 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-heightCSS variable (default20rem). - The box is a region that the keyboard can scroll. The current line has
aria-current="time". Change the words withlabelsor a label pack:title, andseek(a function of the time).
Usage
ts
import { BlessTranscript } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
cues* | BlessCue[] | — | |
time | number | 0 | the time of the media now, in seconds |
follow | boolean | true | keep the current line in view while the media plays |
labels | Partial<{ title: string; seek: (time: string) => string; }> | — |
Events
| Name | Payload | Description |
|---|---|---|
seek | [seconds: number] |