dplesca/go-omxremote

Python control of webservice ?

tomvdb opened this issue · 3 comments

Hi There,

Can I use this to control the omxplayer from a remote python script ? I would essentially just send a post/get request to start and stop a video from my python script.

If so can you provide a basic example of the get/post request to stop and start a video

Thanks :)

Hi,

I've made a few changes today to simplify the URL scheme, so I need to push a new release soon (probably in a few hours). I've written a little bit of documentation for the new urls http api:

This application exposes a simple, minimal HTTP API for interfacing with the player. The exposed endpoints are:

  • GET /files - get all video files as an array of objects with two fields: file, hash; example response:
[{"file":"test.avi","hash":"dGVzdC5hdmk="},{"file":"test.mp4","hash":"dGVzdC5tcDQ="}]
  • POST /start/:hash - starts playback for a video file
  • POST /player/pause - toggles pause/play for video playback
  • POST /player/stop - stops playback
  • POST /player/forward - seeks forward in video
  • POST /player/backward - seeks backward in video
  • POST /player/subs - switches subs stream

One important note is that the start call does not return until the playback is stopped, so your request will probably timeout.

that is perfect thanks, has the executable been updated?

Thanks :)