playfile_with_audio_and_subtitle
Play a video file by path AND select its audio track and/or subtitle once it starts — the "when starting playback" partner of set_audio_and_subtitle.
Instructions
Play a video file by path AND select its audio track and/or subtitle once it starts — the "when starting playback" partner of set_audio_and_subtitle. "file" is required; "audio" is a stream index and "subtitle" is a stream index or "off", using the "index" values from audio_and_subtitle_info. Give at least one of audio/subtitle (else use playfile). Video only. Returns the player-state snapshot.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Path of the video file to play — the `file` field of a `searchmedia` result row, or what `audio_and_subtitle_info` reports. Any path Kodi can reach works, in-library or not. | |
| 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) }. |