playfile
Play one file by path (e.g. a searchmedia result's file): Player.Open auto-selects the audio/video player. Works for any reachable path, in-library or not. A file missing from disk (stale library entry) is reported as an error.
Instructions
Play one file by path (e.g. a searchmedia result's file): Player.Open auto-selects the audio/video player. Works for any reachable path, in-library or not. A file missing from disk (stale library entry) is reported as an error. Returns the player-state snapshot { "state", "type", "time", "totaltime", "progress", "nowplaying": { "media", "id", "title", "artist", … } }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Path of the file to play — the `file` field of a `searchmedia` result row. Any path Kodi can reach works, in-library or not. | |
| instance | No | Target Kodi instance. Omitted uses the default ("(null)"). | |
| fullscreenaudio | No | Audio only: once playback starts, bring Kodi's fullscreen now-playing screen (the `visualisation` window) to the front. Audio playback does not auto-fullscreen the way video does, so without this the player stays behind whatever window is up, showing only the small now-playing strip. Ignored when the open starts video (Kodi already fullscreens that) and a no-op when nothing starts. Note: with no visualisation add-on installed the window renders blank behind the now-playing info. |
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) }. |