queue
Queue an item behind the one now playing, for continuous playback: a searchmedia row's library id (type+id) or a file path; next:true plays it right after the current item. Something must already be playing (start with play/playfile).
Instructions
Queue an item behind the one now playing, for continuous playback: a searchmedia row's library id (type+id) or a file path; next:true plays it right after the current item. Something must already be playing (start with play/playfile). An item whose file is missing from disk (stale library entry) is refused. Returns the player-state snapshot, unchanged by the add — the current item keeps playing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Library id of the item to queue — the `songid`/`episodeid`/`movieid` of a `searchmedia` result row, matching `type`. Give exactly one of `id` or `file`. | |
| file | No | Path of the file to queue — the `file` field of a `searchmedia` result row; any path Kodi can reach works. Give exactly one of `id` or `file`. | |
| next | No | When true, insert the item right after the one now playing ("play next") instead of appending to the end of the queue. | |
| type | No | Kind of library id passed in `id` — picks the item key (songid/episodeid/movieid). Required with `id`; not used with `file`. Must match the playing queue: a song joins audio playback, an episode or movie joins video playback. | |
| instance | No | Target Kodi instance. Omitted uses the default ("(null)"). |
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) }. |