Skip to content
bobboau edited this page Sep 29, 2015 · 2 revisions

Configuration in Bragi-MPD is handled by config.js, an optional JavaScript file. This file should define a configuration object called CONFIG. If no such file is provided Bragi uses the CONFIG object defined in default_config.js, which incidentally would be a good file to use as a starting point for making your own config.js file.

A config file must contain a list of clients which are the list of instances. You can, if you find it useful, have multiple clients for the same MPD instance with different configuration options (like maybe a public client with no password and disabled UI elements, and a password protected client with all options available).

anatomy of config.js

 //sample config
 var CONFIG = {
    clients:[
         {
             name:'main',
             //required, used by the UI

             port:8800, 
             //optional, defaults to 8800, is the websockify port to connect to

             hostname:'localhost',
             //optional, defaults to base host name of page, the host name to try to connect to

             needs_auth:true, 
             //optional, defaults to false, if true will prompt for a password before trying to connect

             disabled_features: 
             {
                 '.MPD_controller':[
                     '.MPD_play','.MPD_pause','.MPD_controller_volume_container'
                 ]
             }
             //optional, list of css selectors, can be flat array of strings, or 'parent':['children']

         }
     ],
     theme:['custom.css']
     //optional list of additional css files to load
};
Clone this wiki locally