Skip to content

Commit 00c0016

Browse files
committed
update api docs
1 parent b5c3925 commit 00c0016

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

api.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,11 @@ It is possible to disable remote control within the context menu of the spotify-
180180
{status: 'not-allowed'}
181181
```
182182

183+
Errors may also be sent like this:
184+
```javascript
185+
{error: 'error message'}
186+
```
187+
183188
## socket.io API
184189

185190
Upon connection, the server will emit the `control_status` event to let the client know whether or not remote control is available. This will be emitted any time it is changed. It can also be requested by the client at any time by emitting a `control_status` event. A boolean is returned, with `true` meaning it is enabled, and `false` being disabled.
@@ -192,11 +197,15 @@ Upon connection, the server will emit the `control_status` event to let the clie
192197
```
193198
* `control_status`:
194199

195-
Returns whether remote control is currently enabled or not in spotify-controller.
200+
Returns whether remote control is currently enabled or not in spotify-controller. This will also be emitted on-demand if remote control is disabled at spotify-controller.
196201
```javascript
197202
true
198203
```
199204

205+
* `error`:
206+
207+
Emitted whenever there is an error. Contains the error message as a string.
208+
200209
* `state`:
201210

202211
Returns the current playback state and track information. This is automatically emitted to all connected clients any time there is a playback state change.

0 commit comments

Comments
 (0)