« Reign Developers

It's really easy to create your own theme for Reign, or even your own native client for iOS or Android. Just follow these simple guidelines and endpoints to get started.

Themes

After enabling 'Advanced Theming' in Reign's preferences. Reign will copy the contents of the default theme to ~/Reign/Spotify/Themes/Default.

Use your favorite editor to customize the html/css/javascript of the theme.

Notice: updates for Reign might add/change functionality, requiring a manual update of your theme.

Bonjour

Reign broadcasts its server under a specific server type: _reign._tcp..

Browsing servers using NSNetServiceBrowser:

1
2
3
NSNetServiceBrowser *netServiceBrowser = [[NSNetServiceBrowser alloc] init];
[netServiceBrowser setDelegate:self];
[netServiceBrowser searchForServicesOfType:@"_reign._tcp." inDomain:@"local."];

Handle discovered services in the delegate methods:

1
2
3
- (void)netServiceBrowser:(NSNetServiceBrowser *)sender didFindService:(NSNetService *)netService moreComing:(BOOL)moreServicesComing {
  // Start resolving etc.
}

Read more about NSNetServiceBrowser.

Endpoints

Every Reign instance runs a web server that responds to several endpoints. For instance: /index.html will return the standard remote control.

/playpause

Toggle's the Spotify player state between playing and paused.

Parameters: none

Returns: nothing

/next

Skips to the next track.

Parameters: none

Returns: nothing

/previous

Skips to the previous track.

Parameters: none

Returns: nothing

/status

Returns the current Spotify client status. Containing now-playing information etc.

Parameters: none

Returns:

state
playing/paused/off
volume
client volume
album
current album
position
position in track in seconds
now_playing
combined track title and artist
starred
boolean indicating if the track is starred
allow_force
true if the server allows play/pause/next/prev commands
url
Spotify url for the current track
track_id
Spotify track id
cover
base64 encoded jpg containing the cover art
duration
track duration in seconds
arist
track artist
name
track title