Difference between revisions of "Documentation:Modules/mqtt"

From VideoLAN Wiki
Jump to navigation Jump to search
Line 32: Line 32:
  
  
=== &#x2192; '''vlc/command'''   <cmd> <arguments> ===
+
=== &#x2192; vlc/command  <cmd> <arguments> ===
:add: <uri> <br />
+
:{|
:delete: <pos> <br />
+
|-
:clear: <br />
+
| '''add''' || <uri> || add <uri> to playlist
:play: <br />
+
|-
:pause: <br />
+
| '''delete''' || <pos> || delete item <pos> in playlist
:stop: <br />
+
|-
:goto: <pos> <br />
+
| '''clear''' ||  || clear the playlist
:next: <br />
+
|-
:prev: <br />
+
| '''play''' ||  <pos> || Start playing item <num>
:seek: <time> <br />
+
|-
:volume: <volume> <br />
+
| '''pause''' ||  || Pause playback
:volup: <X> <br />
+
|-
:voldown: <X> <br />
+
| '''stop''' ||  || Stop stream
:repeat: <0|1> <br />
+
|-
:random: <0|1> <br />
+
| '''goto''' || <pos> || Goto item at index
:loop: <0|1> <br />
+
|-
 +
| '''next''' ||  || Start playing next item in playlist
 +
|-
 +
| '''prev''' ||  || Start playing previous item in playlist
 +
|-
 +
| '''seek''' ||  <time> || Seek to <time> in the current item (in seconds)
 +
|-
 +
| '''volume''' ||  <volume> || Set volume to <volume> (0 to 255)
 +
|-
 +
| '''volup''' ||  <volume> || Increase volume by <volume>
 +
|-
 +
| '''voldown''' ||  <volume> || Descrease volume by <volume>
 +
|-
 +
| '''repeat''' ||  <mode> || Turn on or off playlist repeat mode (0 or 1)
 +
|-
 +
| '''random''' |<mode> || Turn on or off playlist random/shuffle mode (0 or 1)
 +
|-
 +
| '''loop''' |<mode> || Turn on or off playlist loop mode (0 or 1)
 +
|-
 +
|}
  
  
 
=== &#x2190; vlc/status/playlist ===
 
=== &#x2190; vlc/status/playlist ===
Return a JSON representation of the playlist
+
A JSON representation of the playlist is sent whenever the playlist changes.
 +
 
  
 
=== &#x2190; vlc/status/state ===
 
=== &#x2190; vlc/status/state ===
This retained message is sent by VLC when
+
This retained message is sent by VLC whenever the player changes state.
:opening :
+
:{|
:buffering :
+
|-
:playing :
+
| '''opening''' ||
:paused :
+
|-
:stopped :
+
| '''buffering''' ||
:ended :
+
|-
:error :
+
| '''playing''' ||
:notconnected : sent when VLC disconnects from the broker
+
|-
 +
| '''paused''' ||
 +
|-
 +
| '''stopped''' ||
 +
|-
 +
| '''ended''' ||
 +
|-
 +
| '''error''' ||
 +
|-
 +
| '''notconnected''' || sent when VLC disconnects from the broker
 +
|-
 +
|}
  
 
=== &#x2190;  vlc/status/playing ===
 
=== &#x2190;  vlc/status/playing ===
Information about the currently playing item as JSON
+
Information about the currently playing item as JSON is sent whenever a new item starts playing.
 +
 
  
 
=== &#x2190;  vlc/status/time ===
 
=== &#x2190;  vlc/status/time ===
Returns current time in stream as decimal seconds
+
Progress through the current stream as decimal seconds
 +
 
  
 
=== &#x2190;  vlc/status/length ===
 
=== &#x2190;  vlc/status/length ===
Returns duration of current stream as decimal seconds
+
Duration of current stream as decimal seconds
 +
 
  
 
=== &#x2190;  vlc/status/volume ===
 
=== &#x2190;  vlc/status/volume ===
 
The current volume between 0 and 255 (inclusive)
 
The current volume between 0 and 255 (inclusive)
 +
  
 
[[Category:Interfaces]]
 
[[Category:Interfaces]]

Revision as of 20:43, 4 May 2014

NOTE: this module is in active development and has not made it into the main tree yet.

Module: mqtt
Type Interface
First VLC version -
Last VLC version -
Operating system(s) Any that support the mosquitto library
Description control VLC using the MQTT protocol
Shortcut(s) -

This module will let you send control messages to VLC using the MQTT protocol.

Options

  • mqtt-host <string> : Hostname of MQTT broker to connect to default value: localhost
  • mqtt-port <integer> : Port number of MQTT broker to connect to default value: 1883
  • mqtt-prefix <string> : The topic name prefix to use default value: vlc/


Protocol

 : From client to VLC
 : From VLC to client


→ vlc/command <cmd> <arguments>

add <uri> add <uri> to playlist
delete <pos> delete item <pos> in playlist
clear clear the playlist
play <pos> Start playing item <num>
pause Pause playback
stop Stop stream
goto <pos> Goto item at index
next Start playing next item in playlist
prev Start playing previous item in playlist
seek Seek to
volume <volume> Set volume to <volume> (0 to 255)
volup <volume> Increase volume by <volume>
voldown <volume> Descrease volume by <volume>
repeat <mode> Turn on or off playlist repeat mode (0 or 1)
random <mode> Turn on or off playlist random/shuffle mode (0 or 1)
loop <mode> Turn on or off playlist loop mode (0 or 1)


← vlc/status/playlist

A JSON representation of the playlist is sent whenever the playlist changes.


← vlc/status/state

This retained message is sent by VLC whenever the player changes state.

opening
buffering
playing
paused
stopped
ended
error
notconnected sent when VLC disconnects from the broker

← vlc/status/playing

Information about the currently playing item as JSON is sent whenever a new item starts playing.


← vlc/status/time

Progress through the current stream as decimal seconds


← vlc/status/length

Duration of current stream as decimal seconds


← vlc/status/volume

The current volume between 0 and 255 (inclusive)