Matt Kirman

Introducing Spotio: A Spotify Remote

Spotio is an open-source, web-based, multi-user Spotify remote. It features support for viewing the currently playing track, skipping tracks and, most importantly, the ability to control playback.

Spotio is optimised for use in a modern WebKit browser (such as Google Chrome and Mobile Safari). As such it’s possible for multiple people using multiple devices to control the playback of a Spotify playlist with realtime feedback.

Spotio

The need for a Spotify remote with multi-user support reared it’s head whilst working at the office. Spotify is an excellent tool for allowing many people to collaborate on a playlist, but actually controlling what’s played is an area that hasn’t been fully explored yet.

As such, the office is now using a Mac Mini as a dedicated jukebox with our copy of Spotify running on it. This is in turn driving a 5.1 surround sound setup (courtesy of Adam Rhoades) with a central volume control. The final piece of the jigsaw is Spotio - this is installed as an application shortcut on everyone’s PC and iPhone allowing full control of the playlist as long as they’re connected to the office network.

Despite the fact that Spotio is far from finished, I’ve decided to start promoting it so that people can start playing with it, finding bugs and adding features.

Documentation is non-existent (unless you count a readme as documentation) but there isn’t really that much code so it shouldn’t take too much time to rectify matters (in theory).

How It Works

There are two distinct parts to Spotio. First there is the SIMBL bundle that provides us with a very simple API that can be used to control Spotify remotely. Ideally there should only be one connection to the API so that we minimise our impact on the Spotify process. Part two is little more than a proxy server written in Node.js and CoffeeScript that can easily scale to thousands of clients on one server.

The two parts are completely independent, however it’s important to realise that the SIMBL bundle can be used without Node but not vice-versa.

Requirements

  1. Mac OS X 10.6 - 10.5 might work, but it will never be officially supported
  2. SIMBL
  3. Node
  4. Npm for CoffeeScript support

If you want to compile Spotio from source you will also need:

  1. Git VCS
  2. Xcode 4
  3. Rake

Installation

First, make sure you’ve installed the various dependencies. You can then download the latest copy of the Spotio SIMBL bundle and Node server from GitHub. You will then need to move the Spotio bundle into your ~/Library/Application Support/SIMBL/Plugins directory for a single user installation or /Library/Application Support/SIMBL/Plugins for all users.

Alternatively, if you like living on the edge, you can build the latest version of Spotio from source:

$ git clone git://github.com/mattkirman/spotio.git
$ cd spotio
$ rake plugin:build plugin:install

Rake will spit out the build results and then copy the compiled bundle into ~/Library/Application Support/SIMBL/Plugins.

Once you have installed Spotio you will need to restart Spotify for changes to take effect.

Usage

  1. Start Spotify
  2. Open the Spotio Node directory in Finder
  3. Open a terminal (/Applications/Utilities/Terminal), type coffee and drag server.coffee into the terminal window. Hit enter.
  4. Open http://127.0.0.1:8080 (change this IP address for the one on your computer) in Chrome (or another WebKit browser).

By default Spotio binds to all available IP addresses on port 8080. It’s fully compatible with DNS.

Contributing

This project was created as a way for me to learn Node/CoffeeScript and Objective-C. Without doubt things can be improved, so if you would like to lend a hand simply fork the repository and send me a pull request.

If you’re not on GitHub feel free to email me at matt@mattkirman.com.

Comments