/media-services

Using background VLC server, provide front-end for playing and managing playlists

Primary LanguageRuby

This is morphing a lot.  First, we want a music/video server running -
so one of the big subtasks is for satya to run CVLC as a daemon,  and connect to it.

So far, discovery services for other devices:

nexus-7  -  does SSDP, publishes DIAL as second screen device.
chromecast - used to do DIAL,  now mDNs/bonjour for discovery
roku - does SSDP for discovery, HTTP API directly of course.
vsx - mDNS/bonjour
macbook air - mDNS/bonjour for itunes, whats-my-name (http?)
others? UPnP?

See roku-ssdp for service discovery, using the SSDP ruby gem (need to study this)

Also very good - some caching daemons for UPnp ans SSDP
-https://github.com/miniupnp/miniupnp and http://miniupnp.free.fr/
though only C interfaces explained.  Could use a ruby client to read
the daemon's sockets.

e.g., nexus-7
   SSDP M-SEARCH from 192.168.88.19:41472 ST:urn:dial-multiscreen-org:service:dial:1
   SSDP M-SEARCH from 192.168.88.19:41472 ST:urn:mdx-netflix-com:service:target:1


** Sinatra server for media

    Video/

    Music/			- list albums
    Music/Albums		- list songs
    Music/Albums/Music		- play song



** VLC
    See https://wiki.videolan.org/VLC_HTTP_requests/,  and files in satya:/usr/share/vlc/lua/http/requests - the readme there
    was copied to lua-httpd-README.txt in this directory

    Examples:

    clvc --quiet  --play-and-exit --gain 0.25 file:///data/Sounds/ringtones/normalized/planet_claire.ogg

Start up server:

 cvlc --file-logging --logfile cvlc.txt --daemon --intf http --http-host 0.0.0.0 --http-port 9090 --http-password foo

    try adding --no-video (and --quiet?) to the above
    ulimately use  --syslog and --syslog-xxxx settings

  on Mac OS X:

  /Applications/VLC.app/Contents//MacOS/VLC  --intf http --http-host 0.0.0.0 --http-port 9090 --http-password foo



Set volume (100 seems to be 100% - 100% should work if urlencoded?)

   curl -v --user :foo 'http://satyagraha.sacred.net:9090/requests/status.xml?command=volume&val=100'

Add directory full of music (what happens if a cover in there?)

  curl -v --user :foo 'http://satyagraha.sacred.net:9090/requests/status.json?command=in_play&input=file:///data/Music/Gétatchèw%20Mèkurya/Negus%20Of%20Ethiopian%20Sax%20(Ethiopiques%20Vol.14)'

get playlists (very aggressive about adding to playlist):

  curl -v --user :foo 'http://satyagraha.sacred.net:9090/requests/playlist.xml'
  curl -v --user :foo 'http://satyagraha.sacred.net:9090/requests/playlist.json'

Next on playlist:

  curl -v --user :foo 'http://satyagraha.sacred.net:9090/requests/status.json?command=pl_next'

Browse a directory:

  curl -v --user :foo 'http://satyagraha.sacred.net:9090/requests/browse.json?dir=/data/Music/'