Difference between revisions of "Documentation:Modules/mqtt"

From VideoLAN Wiki
Jump to navigation Jump to search
Line 17: Line 17:
 
|default=1883
 
|default=1883
 
|description=Port number of MQTT broker to connect to
 
|description=Port number of MQTT broker to connect to
 +
}}
 +
{{Option
 +
|name=mqtt-username
 +
|value=string
 +
|default=none
 +
|description=The username to connect to the broker with
 +
}}
 +
{{Option
 +
|name=mqtt-password
 +
|value=string
 +
|default=none
 +
|description=The password to connect to the broker with
 
}}
 
}}
 
{{Option
 
{{Option
Line 24: Line 36:
 
|description=The topic name prefix to use
 
|description=The topic name prefix to use
 
}}
 
}}
 
+
{{Option
 +
|name=mqtt-clientid
 +
|value=string
 +
|default=random
 +
|description=The client identifier to connect to the broker as
 +
}}
 +
{{Option
 +
|name=mqtt-keepalive
 +
|value=string
 +
|default=10
 +
|description=The keep alive time for the MQTT protocol (in seconds)
 +
}}
 +
{{Option
 +
|name=mqtt-qos
 +
|value=string
 +
|default=1
 +
|description=The QoS level to publish and subscribe using (0, 1 or 2)
 +
}}
  
 
== Protocol ==
 
== Protocol ==

Revision as of 21:08, 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-username <string> : The username to connect to the broker with default value: none
  • mqtt-password <string> : The password to connect to the broker with default value: none
  • mqtt-prefix <string> : The topic name prefix to use default value: vlc/
  • mqtt-clientid <string> : The client identifier to connect to the broker as default value: random
  • mqtt-keepalive <string> : The keep alive time for the MQTT protocol (in seconds) default value: 10
  • mqtt-qos <string> : The QoS level to publish and subscribe using (0, 1 or 2) default value: 1

Protocol

 : From client to VLC
 : From VLC to client


→ vlc/command <cmd> <arguments>

The following commands are accepted:

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)