Client lib for controlling a Mopidy music server over a WebSocket
Regular and minified versions of Mopidy.js, ready for use, is installed together with the Mopidy music server. When the HTTP frontend is running, the files are available at:
You may need to adjust hostname and port for your local setup.
In the Mopidy.js source repo, you can find the files at:
If you want to use Mopidy.js from Node.js instead of a browser, you can install Mopidy.js using npm:
npm install mopidy
After npm completes, you can import Mopidy.js using
var Mopidy = require("mopidy");
See the Mopidy.js documentation.
Install Node.js and npm. If you're running Ubuntu:
sudo apt-get install nodejs-legacy npm
Enter the source directory, and install all dependencies:
You can now run the tests:
To run tests automatically when you save a file:
npm run-script build
To run other grunt targets which isn't predefined in
package.json and thus isn't available through
PATH=./node_modules/.bin:$PATH grunt foo
Reexport When.js library as
Mopidy.when, to make it easily available to users of Mopidy.js. (Fixes: #1)
wss://as the WebSocket protocol if the page is hosted on
https://. This has no effect if the
webSocketUrlsetting is specified. (Pull request: #2)
- Update links to point to new independent Mopidy.js GitHub project.
- Add support for method calls with by-name arguments. The old calling convention, "by-position-only", is still the default, but this will change in the future. A warning is printed to the console if you don't explicitly select a calling convention. See the docs for details.
Upgrade to when.js 3, which brings great performance improvements and better debugging facilities. If you maintain a Mopidy client, you should review the differences between when.js 2 and 3 and the when.js debugging guide.
Mopidy.ServerError, and connection related errors are of the type
Backwards incompatible change for Node.js users:
var Mopidy = require('mopidy').Mopidy;must be changed to
var Mopidy = require('mopidy');
Add support for Browserify.
- Upgrade dependencies.
- Initial release as a Node.js module to the npm registry.