The TextAlive App API uses a listener pattern for all events. Register a listener object withDocumentation 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.
player.addListener() and implement only the callbacks you need.
PlayerListener
PlayerListener is the full composite type that addListener and removeListener accept:
LoaderListener expands to:
PlayerEventListener
Callbacks for core player state changes: video loading, playback, seeking, and frame updates.onVideoReady
The constructed video object containing phrases, words, and characters with timing information.
onTimerReady
Timer has finished initializing and the player is ready for playback. Call requestPlay() from here or after this event.
The active timer instance.
onMediaElementSet
mediaElement property is updated — either during initialization or when you assign a new element to player.mediaElement.
The new media host element.
onVolumeUpdate
The new volume level, in the range
[0, 100].onTimeUpdate
This event is suppressed while
isVideoSeeking is true. Use onVideoSeek during seek operations instead.Current video position in milliseconds.
onThrottledTimeUpdate
onTimeUpdate. Fires at most once per throttleInterval milliseconds (configured in PlayerOptions). Useful for updating UI elements that don’t need frame-rate precision.
Current video position in milliseconds.
onMediaSeek
videoPosition.
Current media position in milliseconds.
onVideoSeekStart
startVideoSeek() is called and isVideoSeeking becomes true).
onVideoSeek
The updated video position in milliseconds.
onVideoSeekEnd
endVideoSeek() is called and isVideoSeeking becomes false).
onPlay
requestPlay() succeeds).
onPause
requestPause() succeeds).
onStop
requestStop()).
onSeek
The target seek position in milliseconds.
onSeekComplete
onSeek has completed successfully.
The final media position after the seek completes, in milliseconds.
onDispose
dispose(). Use this to clean up any resources tied to the player’s lifecycle.
PlayerAppListener
Callbacks for the lyric app lifecycle: server connection, host readiness, and parameter/media updates from the TextAlive host.onAppLoad
The app status object, including server info and initial song URL from query parameters.
An error message if the server connection failed.
onAppReady
onAppLoad with app.managed === false.
This is the recommended place to call createFromSongUrl() when running standalone (without a host).
The app status object. Check
app.managed to determine whether a host is connected.onAppParameterUpdate
name corresponds to a ParameterWidget.name defined in PlayerAppOptions.parameters.
The parameter variable name.
The new parameter value.
ParameterValue is IColor | string | number | boolean.onAppMediaChange
The new song URL specified by the host.
A promise that resolves when the new video object and
Timer are ready.SongLoaderListener
Callbacks that fire as individual components of the song map are loaded. These are part ofLoaderListener via DataLoaderListener.
onSongLoad
The loaded song metadata object.
Present if loading failed.
onSongMapLoad
The loaded song map containing beats, chords, and segments.
Present if loading failed.
onVocalAmplitudeLoad
vocalAmplitudeEnabled: true in PlayerOptions.
Use
player.getVocalAmplitude(position) and player.getMaxVocalAmplitude() to retrieve vocal amplitude values — do not use the raw vocalAmplitude parameter directly.Present if loading failed.
onValenceArousalLoad
valenceArousalEnabled: true in PlayerOptions.
Use
player.getValenceArousal(position) and player.getMedianValenceArousal() to retrieve valence/arousal values — do not use the raw valenceArousal parameter directly.Present if loading failed.
TextLoaderListener
Callbacks that fire as lyrics content is loaded.onLyricsLoad
LyricsInfo includes the lyrics ID, URL, and Songle processing status.
Lyrics timing metadata including
id, url, diff, processing, and failed fields.Present if loading failed.
onTextLoad
LyricsBody contains the plain text and optional song/artist metadata.
Lyrics text content with optional
artist.name, artist.url, name, and url fields.Present if loading failed.
FontLoaderListener
onFontsLoad
reason contains the error with a fonts array listing the failed entries.
The list of successfully loaded fonts.
Present only if one or more fonts failed to load. The
reason.fonts array lists the fonts that could not be loaded.