/media: Playback State

curl "http://127.0.0.1:9978/media"

With no playback service, a released player or a failed read, the response is {}. When data exists, it returns the structure below; the Content-Type is text/plain, so clients must parse the JSON themselves.

/media response

{
  "state": 3,
  "speed": 1,
  "duration": 7200000,
  "position": 120000,
  "url": "https://example.com/video.m3u8",
  "title": "Sample item",
  "artist": "Demo",
  "artwork": "https://example.com/poster.jpg"
}
FieldTypeNotes
stateinteger3 playing; 6 buffering; 2 ready but not playing; any other state reports 1.
speednumberCurrent speed; 1 is normal.
durationintegerDuration reported by the player in milliseconds; unknown durations may be negative and are not guaranteed to be -1.
positionintegerCurrent position in milliseconds.
urlstringCurrent playback URL; empty when there is none.
titlestringMedia title; empty when there is none.
artiststringThe media artist metadata; empty when there is none.
artworkstringArtwork URI; empty when there is none.
Tip

For richer control (canSeek, canSetSpeed, mediaKey) use /remote. /media only returns a snapshot of playback state.