audioMotion.js

Self-hosting audioMotion

If you’d like to host the audioMotion app in your own web server:

?> Directory listing must be enabled for the file explorer to work - the included .htaccess file should be enough if you’re using an Apache-compatible web server.

!> Playlists, Presets and Custom gradients are saved to the browser’s storage and will only be accessible in the same browser they were saved. The storage is also tied to the server address and port, so if any of those change, data saved on a different address/port won’t be accessible.

config.json file

A config.json file in the same directory as audioMotion’s index.html allows you to configure some server options.

{
  "defaultAccessMode": "local",
  "enableLocalAccess": true,
  "mediaPanel": "open"
}
option values (default in bold) description
defaultAccessMode "local" | "server" Initial (first run) file access mode - user’s device or /music directory on server
enableLocalAccess true | false Whether or not to enable access to local device (true allows user to switch between local or server)
mediaPanel "open" | "close" Initial state of the Media Panel (“close” expands the analyzer area)

URL parameters

The following URL parameters can also be used when accessing audioMotion:

parameter possible values description
mode local | server Starts audioMotion in the desired access mode (local access must be enabled on the server)
mediaPanel open | close Same as the corresponding config.json option, but overrides the server configuration

Use an & character to separate multiple parameters. Example usage:

https://audiomotion.app?mode=server

https://audiomotion.app?mode=local&mediaPanel=close

Server configuration examples

The examples below configure the server to use port 8000 for audioMotion, and map the /music URL to a different directory outside its document root.

Apache:

Listen 8000

<VirtualHost *:8000>
    DocumentRoot "/mnt/HD/HD_a2/web/audioMotion/"
</VirtualHost>

Alias "/music" "/mnt/HD/HD_a2/MUSIC"

<Directory "/mnt/HD/HD_a2/MUSIC">
    Options +Indexes +FollowSymLinks
</Directory>

Lighttpd:

$SERVER["socket"] == ":8000" {
    server.document-root = "/mnt/HD/HD_a2/web/audioMotion/"
    dir-listing.activate = "enable"
    alias.url += ( "/music/" => "/mnt/HD/HD_a2/MUSIC/" )
}

Nginx:

To do…