Apollo-Player icon indicating copy to clipboard operation
Apollo-Player copied to clipboard

Make the web client a Mopidy extension

Open jodal opened this issue 11 years ago • 6 comments

The shortly upcoming Mopidy 0.19 release lets web clients be installed as Mopidy extensions. This makes it possible to install a web client simply by running e.g. pip install Mopidy-Lux and restarting Mopidy. No configuration changes needed. No git clone or download-and-unzip.

Multiple web clients can be installed at the same time, as each client is hosted with a prefix, e.g. Mopidy-Lux on http://localhost:6680/lux/. Mopidy provides a list of all installed web clients on http://localhost:6680/mopidy/.

Mopidy 0.19 hasn't been released yet, but this feature is complete and available in our develop branch. We want web client authors to start working on making all the web clients pip-installable.

The main sources of information is:

  • Extension development in general: http://docs.mopidy.com/en/develop/extensiondev/
  • Web extensions in particular: http://docs.mopidy.com/en/develop/api/http-server/
  • Mopidy-Lux is already pip-installable (except that it's not on PyPI yet, just in the GitHub repo): https://github.com/dz0ny/mopidy-lux

We'll be happy to help you get this working nicely. Let us know if you run into problems.

jodal avatar Jun 23 '14 21:06 jodal

Cool, I'll start working on it.

samcreate avatar Jun 26 '14 17:06 samcreate

Questions: Since my client is running on Node.js would this still be possible to run with this method of installing?

samcreate avatar Jun 26 '14 17:06 samcreate

No, the Mopidy web extensions system only supports:

  • hosting static web clients
  • hosting Tornado server-side apps (a Python web framework) + static files
  • hosting WSGI server-side apps (CGI for Python, basically) + static files

If you don't do much on the Node.js part of your app, a long term solution might be to port that part to a Tornado app which can run directly on Mopidy's web server and be installed as a Mopidy extension.

jodal avatar Jun 26 '14 17:06 jodal

Thanks for the info. The biggest thing I use node for is authentication with twitter (unique id and picture) and crawling spotify for album artwork.

In those aforementioned methods, would it be possible to those same activities? If so, maybe I'll take the time learn some python.

samcreate avatar Jun 27 '14 18:06 samcreate

Yeah, both should be possible with Python and Tornado.

The Spotify album artwork part can probably easily be moved to the client side now, as the new Spotify web API gives easy access to artwork, ref. https://developer.spotify.com/web-api/get-album/

jodal avatar Jun 27 '14 18:06 jodal

Album artwork is now obtainable through Mopidy itself.

It'd be really nice to have this project better integrated into Mopidy and pip installable. I've not looked into exactly what you are doing with twitter authentication but mopidy-mopify uses external services and might be helpful to look at if moving forward with this.

kingosticks avatar May 28 '15 11:05 kingosticks