set_audio_and_subtitle
Switch the audio track and/or subtitle of the video now playing on the target instance. "audio" is a stream index; "subtitle" is a stream index or "off" to hide subtitles — use the "index" values from audio_and_subtitle_info.
Instructions
Switch the audio track and/or subtitle of the video now playing on the target instance. "audio" is a stream index; "subtitle" is a stream index or "off" to hide subtitles — use the "index" values from audio_and_subtitle_info. Omit an argument to leave that stream unchanged; give at least one. Returns the player-state snapshot.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| audio | No | Audio stream index to select — an `index` from `audio_and_subtitle_info`. Omit to leave the audio track unchanged. | |
| instance | No | Target Kodi instance. Omitted uses the default ("(null)"). | |
| subtitle | No | Subtitle stream index to show — an `index` from `audio_and_subtitle_info` — or "off" to hide subtitles. Omit to leave the subtitle unchanged ("off" is distinct from omitting it). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| time | No | Playback position { hours, minutes, seconds, milliseconds }. | |
| type | No | The active player kind. | |
| audio | No | Audio tracks of the playing video (video only): { count, current: { index, language, codec, channels } }. `index` is the set_audio_and_subtitle audio selector. | |
| state | Yes | Playback state; "stopped" means nothing is loaded. | |
| progress | No | Legible position derived from time/totaltime, "elapsed / total (NN%)" e.g. "15:38 / 46:40 (33%)"; absent for live streams with no fixed length. | |
| subtitle | No | Subtitles of the playing video (video only, present only when any exist): { count, enabled, current: { index, language } }. `current` is present only while a subtitle is shown; `index` is the set_audio_and_subtitle subtitle selector. | |
| totaltime | No | The item's duration, same shape as time. | |
| nowplaying | No | The loaded media (present whenever something is loaded): { media (song/episode/movie/…; "unknown" off-library), id (library id, -1 off-library), file, label, title; and where they apply showtitle/season/episode (TV), album/artist/track (song) }. |