Documentation Index
Fetch the complete documentation index at: https://mintlify.com/TextAliveJp/textalive-app-api/llms.txt
Use this file to discover all available pages before exploring further.
IVideo is the root container for all timed rendering units in a TextAlive song — phrases, words, and characters. You access it through player.video after the onVideoReady event fires.
Interface definition
Properties
Collections
All phrases in the video, in chronological order.
All words across all phrases, in chronological order.
All characters across all words, in chronological order.
Timing
The start time of the video in milliseconds. Read-only.
The end time of the video in milliseconds. Read-only.
The total duration of the video in milliseconds. This property is read/write — you can set it to override the computed value.
Counts
Total number of phrases in the video.
Total number of words across all phrases.
Total number of characters across all words.
Boundary accessors
The first phrase in the video.
The last phrase in the video.
The first word in the video.
The last word in the video.
The first character in the video.
The last character in the video.
Methods
progress
Maps a song position to a normalized value in[0, 1] representing how far through the entire video playback has progressed.
Position in the song [ms].
number — a value in [0, 1].
getPhrase
Returns the phrase at the given index.Zero-based phrase index.
IPhrase
getWord
Returns the word at the given index.Zero-based word index.
IWord
getChar
Returns the character at the given index.Zero-based character index.
IChar
findIndex
Returns the index of a given rendering unit within the video’s flat unit list.The rendering unit whose index you want.
number
findPhrase
Finds the phrase active at the given time.Position in the song [ms].
Optional search options. See FindTimedObjectOptions.
IPhrase | null
findPhraseChange
Looks for phrase transitions in the given time range. Useful for detecting when a phrase starts or ends.Start of the time range [ms].
End of the time range [ms].
TimedObjectsInRange<IPhrase> — see TimedObjectsInRange.
findWord
Finds the word active at the given time.Position in the song [ms].
Optional search options.
IWord | null
findWordChange
Looks for word transitions in the given time range.Start of the time range [ms].
End of the time range [ms].
TimedObjectsInRange<IWord>
findChar
Finds the character active at the given time.Position in the song [ms].
Optional search options.
IChar | null
findCharChange
Looks for character transitions in the given time range.Start of the time range [ms].
End of the time range [ms].
TimedObjectsInRange<IChar>
Supporting types
TimedObjectsInRange
Returned by thefind*Change methods. Describes which units entered and left during a time window — ideal for driving enter/exit animations without polling.
entered and left are arrays because multiple short units can start or end within a single render frame.FindTimedObjectOptions
- Pass
{ endTime }to match any unit that overlaps a time range rather than a single instant. - Pass
{ loose: true }to return the nearest unit even when no unit covers the requested time.
IRenderingUnit — base interface
All lyrics units (IPhrase, IWord, IChar) extend IRenderingUnit.
The parent rendering unit.
null for phrases (they have no parent).Child rendering units. For phrases this is an array of
IWord; for words, IChar[]; for chars, [].The preceding unit of the same type.
The following unit of the same type.
Duration of this unit in milliseconds (
endTime - startTime).When set, TextAlive calls this function on every render frame instead of the default template animation. Signature:
(now: number, u: IRenderingUnit) => void.UnitTypes
getType() returns one of the constants in UnitTypes: