When your lyric app is embedded in the TextAlive platform — for example inside a song page on the website — it runs inside anDocumentation 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.
<iframe>. The surrounding page acts as the host. The host controls which song plays and can send parameter values to your app in real time.
Hosted mode only works when your app is served inside an
<iframe> on the TextAlive platform. During local development your app runs in standalone mode (app.managed === false). Register your app at developer.textalive.jp to obtain an app token and enable hosted mode in production.The IPlayerApp interface
Access app state at any time throughplayer.app:
Properties
| Property | Type | Description |
|---|---|---|
managed | boolean | true when connected to a TextAlive host, false in standalone mode |
host | PlayerAppHost | Host info object (includes version: string) — only set when managed is true |
songUrl | string | Song URL specified by the query parameter or overridden by the host |
parameters | ParameterValues | Current values of all declared parameters ({ [name: string]: ParameterValue }) |
isConnecting | boolean | true while the app is still attempting to connect to a host |
status | number | Numeric status code for the app’s current state |
options | PlayerAppOptions | The options object passed to the Player constructor |
connect()
The player callsapp.connect() automatically during initialization. It posts a message to the parent frame up to five times, waiting up to 200 ms for an acknowledgement each time — up to 1 second total. You do not normally need to call this yourself.
PlayerAppOptions
PassPlayerAppOptions as the app property inside PlayerOptions when constructing the player:
Your application token issued by the TextAlive developer portal. The player uses this to authenticate with the TextAlive API server.
List of parameters the host can adjust in real time. Each entry describes one adjustable control shown in the host UI.
ParameterWidget
Each entry inparameters declares one adjustable control:
The internal parameter name. This is the value passed as the first argument to
onAppParameterUpdate.The label shown to users in the host UI. Use a
RegionalText object to provide bilingual labels.The type of widget to render. For example,
"Slider" renders a range slider. The available widget types depend on the TextAlive platform.Configuration options for the widget. For a
"Slider" widget, passing [0, 100] sets the minimum and maximum values.The default value before the host sends any update. Type is
IColor | string | number | boolean.ParameterValue type
onAppParameterUpdate matches the type implied by your widget definition.
RegionalText
UseRegionalText to provide bilingual labels that TextAlive switches based on the user’s display language:
"ja" (Japanese) and "en" (English) are supported.
Hosted mode vs standalone mode
Your app must handle both modes gracefully. The canonical pattern is to checkapp.managed inside onAppReady:
Check app.managed in onAppReady
onAppReady fires once the app has either connected to a host or determined it is running standalone. At this point app.managed is reliable.Load a song manually when standalone
When
app.managed is false (local development, or running outside the platform), call player.createFromSongUrl() yourself.Standalone default song URL
You can also specify a fallback song via thes query parameter when opening your app in a browser:
onAppReady may already have app.songUrl set even in standalone mode. In that case the player begins loading without you needing to call createFromSongUrl() manually.
Full initialization example
The following shows a completePlayer setup that handles both modes: