queue
Queue an item behind the one now playing for continuous playback. Accepts library id or file path, with option to play next.
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 |
|---|---|---|---|
| instance | No | Target Kodi instance. Omitted uses the default ("(null)"). | |
| 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. | |
| 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. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state | Yes | Playback state; "stopped" means nothing is loaded. | |
| type | No | The active player kind. | |
| media | No | Real media type (song/episode/movie/musicvideo/…); "unknown" for an off-library file. | |
| id | No | Library id of the playing item; -1 when off-library. | |
| file | No | Path of the playing item. | |
| label | No | Kodi's display label for the item. | |
| title | No | The item's title (may be empty). | |
| showtitle | No | TV episode: the show's name. | |
| season | No | TV episode: season number. | |
| episode | No | TV episode: episode number. | |
| album | No | Song: the album name. | |
| artist | No | Song: the performers, an array of strings. | |
| track | No | Song: track number on the album. | |
| time | No | Playback position { hours, minutes, seconds, milliseconds }. | |
| totaltime | No | The item's duration, same shape as time. |