Mopidy Audio Server
This is the first stage of my commits for issue #609 that will make the npm module browserify friendly and browser friendly. The grunt-browserify module has been introduced to replace grunt-contrib-concat. Browserify automatically concatenates files and so there is no need for a concat step. The faye-websocket module was problematic so I moved the require out to a separate module within the lib directory. The websocket module is a folder containing a package.json, directing library consumers to the entry point that is appropriate for their environment. Browserify picks browser.js (which simply returns an object holding window.WebSocket) while everyone else gets the faye-websocket module. In addition, as browserify handles all the requires, there's no need to detect the environment or include any pre-built modules. I've removed the pre-built when and faye-websocket files in favour of letting browserify use the modules within node_modules. This should make it easier to maintain dependencies in future versions of this library. One side effect of this browserify compatibility is that, in order to allow the library to be globally available in the browser as `Mopidy`, I've had to set Mopidy as the exported object instead of as a key of the exported object. To elaborate further, the current API would be like the following: var Mopidy = require('mopidy').Mopidy; However, with this change, the API would be like this: var Mopidy = require('mopidy'); I'm not sure whether this would be an issue and so I think it's worth discussing further. It's possible that node developers won't have a problem but, if they did, a potential workaround within the mopidy.js file would be: Mopidy.Mopidy = Mopidy; This would allow developers to choose either of the following: var Mopidy = require('mopidy'); var Mopidy = require('mopidy').Mopidy; Could be a little odd to do this though When testing the browserify build, I noticed a strange error thrown when making the initial websocket connection. I managed to track it down to an IE 'feature' that crops up when you alias in-built functions. In particular, the when module was aliasing setImmediate to an internal function (nextTick.) In a newer version of when, the function is instead aliased to the browserify process.nextTick. This works well because substack already had that covered. With when@2.7.0, IE11 appears to be working well. IE10 is still pending a test. |
||
|---|---|---|
| data | ||
| docs | ||
| js | ||
| mopidy | ||
| requirements | ||
| tests | ||
| tools | ||
| .coveragerc | ||
| .gitignore | ||
| .mailmap | ||
| .travis.yml | ||
| AUTHORS | ||
| fabfile.py | ||
| LICENSE | ||
| MANIFEST.in | ||
| README.rst | ||
| setup.py | ||
******
Mopidy
******
Mopidy is a music server which can play music both from multiple sources, like
your local hard drive, radio streams, and from Spotify and SoundCloud. Searches
combines results from all music sources, and you can mix tracks from all
sources in your play queue. Your playlists from Spotify or SoundCloud are also
available for use.
To control your Mopidy music server, you can use one of Mopidy's web clients,
the Ubuntu Sound Menu, any device on the same network which can control UPnP
MediaRenderers, or any MPD client. MPD clients are available for many
platforms, including Windows, OS X, Linux, Android and iOS.
To get started with Mopidy, check out `the docs <http://docs.mopidy.com/>`_.
- `Documentation <http://docs.mopidy.com/>`_
- `Source code <https://github.com/mopidy/mopidy>`_
- `Issue tracker <https://github.com/mopidy/mopidy/issues>`_
- `CI server <https://travis-ci.org/mopidy/mopidy>`_
- `Download development snapshot <https://github.com/mopidy/mopidy/tarball/develop#egg=mopidy-dev>`_
- IRC: ``#mopidy`` at `irc.freenode.net <http://freenode.net/>`_
- Mailing list: `mopidy@googlegroups.com <https://groups.google.com/forum/?fromgroups=#!forum/mopidy>`_
- Twitter: `@mopidy <https://twitter.com/mopidy/>`_
.. image:: https://pypip.in/v/Mopidy/badge.png
:target: https://crate.io/packages/Mopidy/
:alt: Latest PyPI version
.. image:: https://pypip.in/d/Mopidy/badge.png
:target: https://crate.io/packages/Mopidy/
:alt: Number of PyPI downloads
.. image:: https://travis-ci.org/mopidy/mopidy.png?branch=develop
:target: https://travis-ci.org/mopidy/mopidy
:alt: Travis CI build status
.. image:: https://coveralls.io/repos/mopidy/mopidy/badge.png?branch=develop
:target: https://coveralls.io/r/mopidy/mopidy?branch=develop
:alt: Test coverage