mirror of
https://github.com/badaix/snapcast.git
synced 2025-04-28 09:47:09 +02:00
Update documentation
This commit is contained in:
parent
636b24a074
commit
96b55c9b24
3 changed files with 149 additions and 132 deletions
|
@ -108,7 +108,7 @@ Available stream sources are:
|
|||
|
||||
### Client
|
||||
|
||||
The client will use as audio backend the system's low level audio API to have the best possible control and most precise timing to achieve perfectly synced playback.
|
||||
The client will use as audio backend the system's low level audio API to have the best possible control and most precise timing to achieve perfectly synced playback.
|
||||
|
||||
Available audio backends are configured using the `--player` command line parameter:
|
||||
|
||||
|
|
|
@ -184,6 +184,18 @@ The Server JSON object contains a list of Groups and Streams. Every Group holds
|
|||
|
||||
## Requests
|
||||
|
||||
Any request might be answered with a generic [json-rpc-2.0 error](https://www.jsonrpc.org/specification#error_object):
|
||||
|
||||
```json
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": -32700, "message": "Parse error"}}
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": -32600, "message": "Invalid request"}}
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": -32601, "message": "Method not found"}}
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": -32602, "message": "Invalid params"}}
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": -32603, "message": "Internal error"}}
|
||||
```
|
||||
|
||||
Some requests might return more specific json error messages.
|
||||
|
||||
### Client.GetStatus
|
||||
|
||||
#### Request
|
||||
|
@ -432,64 +444,82 @@ The Server JSON object contains a list of Groups and Streams. Every Group holds
|
|||
|
||||
#### Request
|
||||
|
||||
Same request as in [Plugin.Stream.Player.Control](stream_plugin.md#pluginstreamplayercontrol), but with the method `Stream.Control`.
|
||||
|
||||
```json
|
||||
{"id": 1, "jsonrpc": "2.0", "method": "Stream.Control", "params": {"command": "<command>", "params": { "<param 1>": <value 1>, "<param 2>": <value 2>}}}
|
||||
{"id":4,"jsonrpc":"2.0","method":"Stream.Control","params":{"id":"Spotify", "command": "next", params: {}}}
|
||||
{"id":4,"jsonrpc":"2.0","method":"Stream.Control","params":{"id":"Spotify", "command": "seek", "param": "60"}}
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```json
|
||||
{"id": 1, "jsonrpc": "2.0", "method": "Stream.Control", "params": {"id": "Spotify", "command": "next", params: {}}}
|
||||
{"id": 1, "jsonrpc": "2.0", "method": "Stream.Control", "params": {"id": "Spotify", "command": "seek", "param": "60"}}
|
||||
```
|
||||
|
||||
#### Supported `command`s
|
||||
|
||||
* `Play`: Start playback
|
||||
* `params`: none
|
||||
* `Pause`: Stop playback
|
||||
* `params`: none
|
||||
* `PlayPause`: Toggle play/pause
|
||||
* `params`: none
|
||||
* `Stop`: Stop playback
|
||||
* `params`: none
|
||||
* `Next`: Skip to next track
|
||||
* `params`: none
|
||||
* `Previous`: Skip to previous track
|
||||
* `params`: none
|
||||
* `Seek`: Seek forward or backward in the current track
|
||||
* `params`:
|
||||
* `Offset`: [float] seek offset in seconds
|
||||
* `SetPosition`: Set the current track position in seconds
|
||||
* `params`:
|
||||
* `Position`: [float] the new track position
|
||||
* `TrackId`: [string] the optional currently playing track's identifier
|
||||
See [Plugin.Stream.Player.Control](stream_plugin.md#pluginstreamplayercontrol).
|
||||
|
||||
#### Response
|
||||
|
||||
##### Success
|
||||
|
||||
```json
|
||||
TODO
|
||||
{"id": 1, "jsonrpc": "2.0", "result": "ok"}
|
||||
```
|
||||
|
||||
##### Error
|
||||
|
||||
```json
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": -32603, "message": "Stream not found"}}
|
||||
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": 1, "message": "Stream can not be controlled"}}
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": 2, "message": "Stream property canGoNext is false"}}
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": 3, "message": "Stream property canGoPrevious is false"}}
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": 4, "message": "Stream property canPlay is false"}}
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": 5, "message": "Stream property canPause is false"}}
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": 6, "message": "Stream property canSeek is false"}}
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": 7, "message": "Stream property canControl is false"}}
|
||||
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": -32602, "message": "Command '<command>' not supported"}}
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": -32602, "message": "Parameter 'commmand' is missing"}}
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": -32602, "message": "SetPosition requires parameters 'Position'"}}
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": -32602, "message": "Seek requires parameter 'Offset'"}}
|
||||
```
|
||||
|
||||
### Stream.SetProperty
|
||||
|
||||
#### Request
|
||||
|
||||
Same request as in [Plugin.Stream.Player.SetProperty](stream_plugin.md#pluginstreamplayersetproperty), but with the method `Stream.SetProperty`.
|
||||
|
||||
```json
|
||||
{"id": 1, "jsonrpc": "2.0", "method": "Stream.SetProperty", "params": {"id": "Pipe", "property": property, "value": value}}
|
||||
{"id":4,"jsonrpc":"2.0","method":"Stream.Control","params":{"id":"Spotify", "command": "next", params: {}}}
|
||||
{"id":4,"jsonrpc":"2.0","method":"Stream.Control","params":{"id":"Spotify", "command": "seek", "param": "60000"}}
|
||||
```
|
||||
|
||||
#### Supported `property`s
|
||||
|
||||
* `loopStatus`: [string] the current repeat status, one of:
|
||||
* `none`: the playback will stop when there are no more tracks to play
|
||||
* `track`: the current track will start again from the begining once it has finished playing
|
||||
* `playlist`: the playback loops through a list of tracks
|
||||
* `shuffle`: [bool] play playlist in random order
|
||||
* `volume`: [int] voume in percent, valid range [0..100]
|
||||
* `rate`: [float] The current playback rate, valid range (0..)
|
||||
See [Plugin.Stream.Player.SetProperty](stream_plugin.md#pluginstreamplayersetproperty).
|
||||
|
||||
#### Response
|
||||
|
||||
##### Success
|
||||
|
||||
```json
|
||||
TODO
|
||||
{"id": 1, "jsonrpc": "2.0", "result": "ok"}
|
||||
```
|
||||
|
||||
##### Error
|
||||
|
||||
```json
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": -32602, "message": "Property '<property>' not supported"}}
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": -32602, "message": "Parameter 'property' is missing"}}
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": -32602, "message": "Parameter 'value' is missing"}}
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": -32602, "message": "Value for loopStatus must be one of 'none', 'track', 'playlist'"}}
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": -32602, "message": "Value for shuffle must be bool"}}
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": -32602, "message": "Value for volume must be an int"}}
|
||||
{"id": 1, "jsonrpc": "2.0", "error": {"code": -32602, "message": "Value for rate must be float"}}
|
||||
```
|
||||
|
||||
## Notifications
|
||||
|
@ -550,10 +580,10 @@ TODO
|
|||
|
||||
### Stream.OnProperties
|
||||
|
||||
Same notification as in [Plugin.Stream.Player.Properties](stream_plugin.md#pluginstreamplayerproperties), but with the method `Stream.OnProperties`.
|
||||
|
||||
```json
|
||||
{"jsonrpc":"2.0","method":"Stream.OnProperties","params":{"id":"stream 1", "metadata": {"album": "some album", "artist": "some artist", "track": "some track"...}}}
|
||||
|
||||
{"jsonrpc":"2.0","method":"Stream.OnProperties","params":{"id":"Meta","properties":{"canControl":true,"canGoNext":true,"canGoPrevious":true,"canPause":true,"canPlay":true,"canSeek":true,"loopStatus":"none","metadata":{"album":"Doldinger","albumArtist":["Klaus Doldinger's Passport"],"artUrl":"http://coverartarchive.org/release/0d4ff56b-2a2b-43b5-bf99-063cac1599e5/16940576164-250.jpg","artist":["Klaus Doldinger's Passport feat. Nils Landgren"],"contentCreated":"2016","duration":305.2929992675781,"genre":["Jazz"],"title":"Soul Town","trackId":"7","trackNumber":6,"url":"Klaus Doldinger's Passport - Doldinger (2016)/06 - Soul Town.mp3"},"playbackStatus":"playing","position":221.82400512695313,"shuffle":false,"volume":97}}}
|
||||
```
|
||||
|
||||
### Server.OnUpdate
|
||||
|
|
|
@ -2,27 +2,28 @@
|
|||
# Stream plugin
|
||||
|
||||
A stream plugin is (this might change in future) an executable binary or script that is started by the server for a specific stream and offers playback control capabilities and provides information about the stream's state, as well as metadata for the currently playing track.
|
||||
The Snapcast server communicates via stdin/stdout with the plugin and sends newline delimited JSON-RPC commands and receives responses and notifications from the plugin, as described below. In upcoming releases shared library plugins might be supported as well.
|
||||
The Snapcast server communicates via stdin/stdout with the plugin and sends newline delimited JSON-RPC> commands and receives responses and notifications from the plugin, as described below. In upcoming releases shared library plugins might be supported as well.
|
||||
|
||||
## Requests
|
||||
|
||||
A Stream plugin must support and handle the following requests, sent by the Snapcast server
|
||||
A Stream plugin must support and handle the following [requests](#requests), sent by the Snapcast server
|
||||
|
||||
* [Plugin.Stream.Player.Control](#pluginstreamplayercontrol)
|
||||
* [Plugin.Stream.Player.SetProperty](#pluginstreamplayersetproperty)
|
||||
* [Plugin.Stream.Player.GetProperties](#pluginstreamplayergetproperties)
|
||||
|
||||
## Notifications
|
||||
|
||||
The following messages can be sent by the plugin to notify the server about changes. The `Plugin.Stream.Ready` should be fired as soon as the plugin is ready to receive commands, upon reception, the server will query the stream's [properties](#pluginstreamplayergetproperties)
|
||||
The following [notifications](#notifications) can be sent by the plugin to notify the server about changes. The `Plugin.Stream.Ready` should be fired as soon as the plugin is ready to receive commands, upon reception, the server will query the stream's [properties](#pluginstreamplayergetproperties)
|
||||
|
||||
* [Plugin.Stream.Player.Properties](#pluginstreamplayerproperties)
|
||||
* [Plugin.Stream.Log](#pluginstreamlog)
|
||||
* [Plugin.Stream.Ready](#pluginstreamready)
|
||||
|
||||
## Requests
|
||||
|
||||
The following requests will be sent by the Snapserver to the stream plugin. Upon startup Snapserver will wait for the plugin's [ready notification](#pluginstreamready) to [query the supported properties](Plugin.Stream.Player.GetProperties). The controlling capabilities are encoded into these boolean properties: `canGoNext`, `canGoPrevious`, `canPlay`, `canPause`, `canSeek`, `canControl`.
|
||||
If `canControl` is `false`, the server will not send any control commands to the plugin.
|
||||
|
||||
### Plugin.Stream.Player.Control
|
||||
|
||||
Used to control the player
|
||||
Used to control the player. The property `canControl` must be `true`.
|
||||
|
||||
```json
|
||||
{"id": 1, "jsonrpc": "2.0", "method": "Plugin.Stream.Player.Control", "params": {"command": "<command>", "params": { "<param 1>": <value 1>, "<param 2>": <value 2>}}}
|
||||
|
@ -30,22 +31,22 @@ Used to control the player
|
|||
|
||||
#### Supported `command`s
|
||||
|
||||
* `Play`: Start playback
|
||||
* `Play`: Start playback (if `canPlay` is `true`)
|
||||
* `params`: none
|
||||
* `Pause`: Stop playback
|
||||
* `Pause`: Stop playback (if `canPause` is `true`)
|
||||
* `params`: none
|
||||
* `PlayPause`: Toggle play/pause
|
||||
* `PlayPause`: Toggle play/pause (if `canPause` is `true`)
|
||||
* `params`: none
|
||||
* `Stop`: Stop playback
|
||||
* `Stop`: Stop playback (if `canControl` is `true`)
|
||||
* `params`: none
|
||||
* `Next`: Skip to next track
|
||||
* `Next`: Skip to next track (if `canGoNext` is `true`)
|
||||
* `params`: none
|
||||
* `Previous`: Skip to previous track
|
||||
* `Previous`: Skip to previous track (if `canGoPrevious` is `true`)
|
||||
* `params`: none
|
||||
* `Seek`: Seek forward or backward in the current track
|
||||
* `Seek`: Seek forward or backward in the current track (if `canSeek` is `true`)
|
||||
* `params`:
|
||||
* `Offset`: [float] seek offset in seconds
|
||||
* `SetPosition`: Set the current track position in seconds
|
||||
* `SetPosition`: Set the current track position in seconds (if `canSeek` is `true`)
|
||||
* `params`:
|
||||
* `Position`: [float] the new track position
|
||||
* `TrackId`: [string] the optional currently playing track's identifier
|
||||
|
@ -66,12 +67,12 @@ Success:
|
|||
|
||||
Error:
|
||||
|
||||
```json
|
||||
todo
|
||||
```
|
||||
Any [json-rpc 2.0 conformant error](https://www.jsonrpc.org/specification#error_object) with an error message that helps the user to diagnose the error
|
||||
|
||||
### Plugin.Stream.Player.SetProperty
|
||||
|
||||
Snapserver will send the `SetProperty` command to the plugin, if `canControl` is `true`.
|
||||
|
||||
```json
|
||||
{"id": 1, "jsonrpc": "2.0", "method": "Plugin.Stream.Player.SetProperty", "params": {"<property>", <value>}}
|
||||
```
|
||||
|
@ -88,17 +89,15 @@ todo
|
|||
|
||||
#### Expected response
|
||||
|
||||
Success:
|
||||
##### Success
|
||||
|
||||
```json
|
||||
{"id": 1, "jsonrpc": "2.0", "result": "ok"}
|
||||
```
|
||||
|
||||
Error:
|
||||
##### Error
|
||||
|
||||
```json
|
||||
todo
|
||||
```
|
||||
Any [json-rpc 2.0 conformant error](https://www.jsonrpc.org/specification#error_object) with an error message that helps the user to diagnose the error
|
||||
|
||||
### Plugin.Stream.Player.GetProperties
|
||||
|
||||
|
@ -106,16 +105,6 @@ todo
|
|||
{"id": 1, "jsonrpc": "2.0", "method": "Plugin.Stream.Player.GetProperties"}
|
||||
```
|
||||
|
||||
#### Expected response
|
||||
|
||||
Success:
|
||||
|
||||
```json
|
||||
{"id": 1, "jsonrpc": "2.0", "result": {"canControl":true,"canGoNext":true,"canGoPrevious":true,"canPause":true,"canPlay":true,"canSeek":false,"loopStatus":"none","playbackStatus":"playing","position":93.394,"shuffle":false,"volume":86}}
|
||||
|
||||
{"id": 1, "jsonrpc": "2.0", "result": {"canControl":true,"canGoNext":true,"canGoPrevious":true,"canPause":true,"canPlay":true,"canSeek":true,"loopStatus":"none","metadata":{"album":"Doldinger","albumArtist":["Klaus Doldinger's Passport"],"artUrl":"http://coverartarchive.org/release/0d4ff56b-2a2b-43b5-bf99-063cac1599e5/16940576164-250.jpg","artist":["Klaus Doldinger's Passport feat. Nils Landgren"],"contentCreated":"2016","duration":305.2929992675781,"genre":["Jazz"],"musicbrainzAlbumId":"0d4ff56b-2a2b-43b5-bf99-063cac1599e5","title":"Soul Town","trackId":"7","trackNumber":6,"url":"Klaus Doldinger's Passport - Doldinger (2016)/06 - Soul Town.mp3"},"playbackStatus":"playing","position":72.79499816894531,"shuffle":false,"volume":97}}
|
||||
```
|
||||
|
||||
#### Supported `property`s
|
||||
|
||||
* `playbackStatus`: [string] The current playback status, one of:
|
||||
|
@ -130,83 +119,81 @@ Success:
|
|||
* `volume`: [int] Voume in percent, valid range [0..100]
|
||||
* `rate`: [float] The current playback rate, valid range (0..)
|
||||
* `position`: [float] Current playback position in seconds
|
||||
* `canGoNext`: [bool] Whether the client can call the Next method on this interface and expect the current track to change
|
||||
* `canGoPrevious`: [bool] Whether the client can call the Previous method on this interface and expect the current track to change
|
||||
* `canPlay`: [bool] Whether playback can be started using Play or PlayPause
|
||||
* `canPause`: [bool] Whether playback can be paused using Pause or PlayPause
|
||||
* `canSeek`: [bool] Whether the client can control the playback position using Seek and SetPosition
|
||||
* `canGoNext`: [bool] Whether the client can call the `Next` method on this interface and expect the current track to change
|
||||
* `canGoPrevious`: [bool] Whether the client can call the `Previous` method on this interface and expect the current track to change
|
||||
* `canPlay`: [bool] Whether playback can be started using `Play` or `PlayPause`
|
||||
* `canPause`: [bool] Whether playback can be paused using `Pause` or `PlayPause`
|
||||
* `canSeek`: [bool] Whether the client can control the playback position using `Seek` and `SetPosition`
|
||||
* `canControl`: [bool] Whether the media player may be controlled over this interface
|
||||
* `metadata`: [json] message with the following (optional) fields:
|
||||
* `trackId`: [string] A unique identity for this track within the context of an MPRIS object (eg: tracklist).
|
||||
* `file`: [string] The current song.
|
||||
* `duration`: [float] The duration of the song in seconds; may contain a fractional part.
|
||||
* `artist`: [list of strings] The track artist(s).
|
||||
* `artistSort`: [list of strings] Same as artist, but for sorting. This usually omits prefixes such as “The”.
|
||||
* `album`: [string] The album name.
|
||||
* `albumSort`: [string] Same as album, but for sorting.
|
||||
* `albumArtist`: [list of strings] The album artist(s).
|
||||
* `albumArtistSort`: [list of strings] Same as albumartist, but for sorting.
|
||||
* `name`: [string] A name for this song. This is not the song title. The exact meaning of this tag is not well-defined. It is often used by badly configured internet radio stations with broken tags to squeeze both the artist name and the song title in one tag.
|
||||
* `date`: [string] The song’s release date. This is usually a 4-digit year.
|
||||
* `originalDate`: [string] The song’s original release date.
|
||||
* `composer`: [list of strings] The composer(s) of the track.
|
||||
* `performer`: [string] The artist who performed the song.
|
||||
* `conductor`: [string] The conductor who conducted the song.
|
||||
* `work`: [string] “a work is a distinct intellectual or artistic creation, which can be expressed in the form of one or more audio recordings”
|
||||
* `grouping`: [string] “used if the sound belongs to a larger category of sounds/music” (from the IDv2.4.0 TIT1 description).
|
||||
* `comment`: [list of string] A (list of) freeform comment(s)
|
||||
* `label`: [string] The name of the label or publisher.
|
||||
* `musicbrainzArtistId`: [string] The artist id in the [MusicBrainz](https://picard-docs.musicbrainz.org/en/appendices/tag_mapping.html) database.
|
||||
* `musicbrainzAlbumId`: [string] The album id in the [MusicBrainz](https://picard-docs.musicbrainz.org/en/appendices/tag_mapping.html) database.
|
||||
* `musicbrainzAlbumArtistId`: [string] The album artist id in the [MusicBrainz](https://picard-docs.musicbrainz.org/en/appendices/tag_mapping.html) database.
|
||||
* `musicbrainzTrackId`: [string] The track id in the [MusicBrainz](https://picard-docs.musicbrainz.org/en/appendices/tag_mapping.html) database.
|
||||
* `musicbrainzReleaseTrackId`: [string] The release track id in the [MusicBrainz](https://picard-docs.musicbrainz.org/en/appendices/tag_mapping.html) database.
|
||||
* `musicbrainzWorkId`: [string] The work id in the [MusicBrainz](https://picard-docs.musicbrainz.org/en/appendices/tag_mapping.html) database.
|
||||
* `lyrics`: [list of strings] The lyricist(s) of the track
|
||||
* `bpm`: [integer] The speed of the music, in beats per minute.
|
||||
* `autoRating`: [float] An automatically-generated rating, based on things such as how often it has been played. This should be in the range 0.0 to 1.0.
|
||||
* `comment`: [list of strings] A (list of) freeform comment(s).
|
||||
* `composer`: [list of strings] The composer(s) of the track.
|
||||
* `contentCreated`: [string] Date/Time: When the track was created. Usually only the year component will be useful.
|
||||
* `discNumber`: [integer] The disc number on the album that this track is from.
|
||||
* `firstUsed`: [string] Date/Time: When the track was first played.
|
||||
* `genre`: [list of strings] List of Strings: The genre(s) of the track.
|
||||
* `lastUsed`: [string] Date/Time: When the track was last played.
|
||||
* `lyricist`: [list of strings] List of Strings: The lyricist(s) of the track.
|
||||
* `title`: [string] The track title.
|
||||
* `trackNumber`: [string] The track number on the album disc.
|
||||
* `url`: [string uri] The location of the media file.
|
||||
* `artUrl`: [string uri] The location of an image representing the track or album. Clients should not assume this will continue to exist when the media player stops giving out the URL.
|
||||
* `useCount`: [integer] The number of times the track has been played.
|
||||
* `userRating`: [float] A user-specified rating. This should be in the range 0.0 to 1.0.
|
||||
* `spotifyArtistId`: [string] The [Spotify Artist ID](https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids)
|
||||
* `spotifyTrackId`: [string] The [Spotify Track ID](https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids)
|
||||
|
||||
Error:
|
||||
#### Expected response
|
||||
|
||||
##### Success
|
||||
|
||||
```json
|
||||
todo
|
||||
{"id": 1, "jsonrpc": "2.0", "result": {"canControl":true,"canGoNext":true,"canGoPrevious":true,"canPause":true,"canPlay":true,"canSeek":false,"loopStatus":"none","playbackStatus":"playing","position":93.394,"shuffle":false,"volume":86}}
|
||||
|
||||
{"id": 1, "jsonrpc": "2.0", "result": {"canControl":true,"canGoNext":true,"canGoPrevious":true,"canPause":true,"canPlay":true,"canSeek":true,"loopStatus":"none","metadata":{"album":"Doldinger","albumArtist":["Klaus Doldinger's Passport"],"artUrl":"http://coverartarchive.org/release/0d4ff56b-2a2b-43b5-bf99-063cac1599e5/16940576164-250.jpg","artist":["Klaus Doldinger's Passport feat. Nils Landgren"],"contentCreated":"2016","duration":305.2929992675781,"genre":["Jazz"],"musicbrainzAlbumId":"0d4ff56b-2a2b-43b5-bf99-063cac1599e5","title":"Soul Town","trackId":"7","trackNumber":6,"url":"Klaus Doldinger's Passport - Doldinger (2016)/06 - Soul Town.mp3"},"playbackStatus":"playing","position":72.79499816894531,"shuffle":false,"volume":97}}
|
||||
```
|
||||
|
||||
##### Error
|
||||
|
||||
Any [json-rpc 2.0 conformant error](https://www.jsonrpc.org/specification#error_object) with an error message that helps the user to diagnose the error
|
||||
|
||||
## Notifications
|
||||
|
||||
### Plugin.Stream.Player.Metadata
|
||||
|
||||
TODO: Metadata are part of the properties
|
||||
|
||||
```json
|
||||
{"jsonrpc": "2.0", "method": "Plugin.Stream.Player.Metadata", "params": {"artist":["Travis Scott & HVME"],"file":"http://wdr-1live-live.icecast.wdr.de/wdr/1live/live/mp3/128/stream.mp3","name":"1Live, Westdeutscher Rundfunk Koeln","title":"Goosebumps (Remix)","trackId":"3"}}
|
||||
```
|
||||
|
||||
#### Supported `tag`s
|
||||
|
||||
* `trackId`: [string] A unique identity for this track within the context of an MPRIS object (eg: tracklist).
|
||||
* `file`: [string] The current song.
|
||||
* `duration`: [float] The duration of the song in seconds; may contain a fractional part.
|
||||
* `artist`: [list of strings] The track artist(s).
|
||||
* `artistSort`: [list of strings] Same as artist, but for sorting. This usually omits prefixes such as “The”.
|
||||
* `album`: [string] The album name.
|
||||
* `albumSort`: [string] Same as album, but for sorting.
|
||||
* `albumArtist`: [list of strings] The album artist(s).
|
||||
* `albumArtistSort`: [list of strings] Same as albumartist, but for sorting.
|
||||
* `name`: [string] A name for this song. This is not the song title. The exact meaning of this tag is not well-defined. It is often used by badly configured internet radio stations with broken tags to squeeze both the artist name and the song title in one tag.
|
||||
* `date`: [string] The song’s release date. This is usually a 4-digit year.
|
||||
* `originalDate`: [string] The song’s original release date.
|
||||
* `composer`: [list of strings] The composer(s) of the track.
|
||||
* `performer`: [string] The artist who performed the song.
|
||||
* `conductor`: [string] The conductor who conducted the song.
|
||||
* `work`: [string] “a work is a distinct intellectual or artistic creation, which can be expressed in the form of one or more audio recordings”
|
||||
* `grouping`: [string] “used if the sound belongs to a larger category of sounds/music” (from the IDv2.4.0 TIT1 description).
|
||||
* `comment`: [list of string] A (list of) freeform comment(s)
|
||||
* `label`: [string] The name of the label or publisher.
|
||||
* `musicbrainzArtistId`: [string] The artist id in the [MusicBrainz](https://picard-docs.musicbrainz.org/en/appendices/tag_mapping.html) database.
|
||||
* `musicbrainzAlbumId`: [string] The album id in the [MusicBrainz](https://picard-docs.musicbrainz.org/en/appendices/tag_mapping.html) database.
|
||||
* `musicbrainzAlbumArtistId`: [string] The album artist id in the [MusicBrainz](https://picard-docs.musicbrainz.org/en/appendices/tag_mapping.html) database.
|
||||
* `musicbrainzTrackId`: [string] The track id in the [MusicBrainz](https://picard-docs.musicbrainz.org/en/appendices/tag_mapping.html) database.
|
||||
* `musicbrainzReleaseTrackId`: [string] The release track id in the [MusicBrainz](https://picard-docs.musicbrainz.org/en/appendices/tag_mapping.html) database.
|
||||
* `musicbrainzWorkId`: [string] The work id in the [MusicBrainz](https://picard-docs.musicbrainz.org/en/appendices/tag_mapping.html) database.
|
||||
* `lyrics`: [list of strings] The lyricist(s) of the track
|
||||
* `bpm`: [integer] The speed of the music, in beats per minute.
|
||||
* `autoRating`: [float] An automatically-generated rating, based on things such as how often it has been played. This should be in the range 0.0 to 1.0.
|
||||
* `comment`: [list of strings] A (list of) freeform comment(s).
|
||||
* `composer`: [list of strings] The composer(s) of the track.
|
||||
* `contentCreated`: [string] Date/Time: When the track was created. Usually only the year component will be useful.
|
||||
* `discNumber`: [integer] The disc number on the album that this track is from.
|
||||
* `firstUsed`: [string] Date/Time: When the track was first played.
|
||||
* `genre`: [list of strings] List of Strings: The genre(s) of the track.
|
||||
* `lastUsed`: [string] Date/Time: When the track was last played.
|
||||
* `lyricist`: [list of strings] List of Strings: The lyricist(s) of the track.
|
||||
* `title`: [string] The track title.
|
||||
* `trackNumber`: [string] The track number on the album disc.
|
||||
* `url`: [string uri] The location of the media file.
|
||||
* `artUrl`: [string uri] The location of an image representing the track or album. Clients should not assume this will continue to exist when the media player stops giving out the URL.
|
||||
* `useCount`: [integer] The number of times the track has been played.
|
||||
* `userRating`: [float] A user-specified rating. This should be in the range 0.0 to 1.0.
|
||||
* `spotifyArtistId`: [string] The [Spotify Artist ID](https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids)
|
||||
* `spotifyTrackId`: [string] The [Spotify Track ID](https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids)
|
||||
|
||||
### Plugin.Stream.Player.Properties
|
||||
|
||||
```json
|
||||
{"jsonrpc": "2.0", "method": "Plugin.Stream.Player.Properties", "params": {"canControl":true,"canGoNext":true,"canGoPrevious":true,"canPause":true,"canPlay":true,"canSeek":false,"loopStatus":"none","playbackStatus":"playing","position":593.394,"shuffle":false,"volume":86}}
|
||||
```
|
||||
|
||||
[Supported `property`s](#supported-propertys)
|
||||
Same format as in [GetProperties](#pluginstreamplayergetproperties). If `metadata` is missing, the last known metadata will be used, so the plugin must not send the complete metadata if one of the properties is updated.
|
||||
|
||||
### Plugin.Stream.Log
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue