The Remixer class is a singleton class that keeps track of all the Variables and deals with saving/syncing its values.
The following methods are the most commonly used to enable Remixer in your app.
- remixer.start()
- remixer.stop()
- remixer.addBooleanVariable()
- remixer.addColorVariable()
- remixer.addNumberVariable()
- remixer.addRangeVariable()
- remixer.addStringVariable()
Appends the HTML iFrame to body of client app. Attaches key listener to toggle Overlay visibility.
remixer.start();
remixer.start(remoteConfig);
-
remoteConfig: object
The optional firebase configuration. Provide this configuration if you wish to use the remote controller.
var remoteConfig = { apiKey: "<API_KEY>", authDomain: "<PROJECT_ID>.firebaseapp.com", databaseURL: "https://<DATABASE_NAME>.firebaseio.com" ... };
Removes iFrame and attached key listener.
remixer.stop();
Adds a boolean Variable to array of Variables with optional callback.
remixer.addBooleanVariable(key, defaultValue);
remixer.addBooleanVariable(key, defaultValue, callback(variable) { ... } );
-
key: string
The key of the Variable.
-
defaultValue: boolean
The initial default value of the variable.
-
OPTIONAL
callback: functionThe callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument.
Returns BooleanVariable
Adds a color variable to array of variables with optional callback.
remixer.addColorVariable(key, defaultValue);
remixer.addColorVariable(key, defaultValue, limitedToValues);
remixer.addColorVariable(key, defaultValue, limitedToValues, callback(variable) { ... } );
-
key: string
The key of the Variable.
-
defaultValue: string
The initial default value of the variable.
-
OPTIONAL
limitedToValues: string[]The optional array of allowed values.
-
OPTIONAL
callback: functionThe callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument.
Returns ColorVariable
Adds a number variable to array of variables with optional callback.
remixer.addNumberVariable(key, defaultValue);
remixer.addNumberVariable(key, defaultValue, limitedToValues);
remixer.addNumberVariable(key, defaultValue, limitedToValues, callback(variable) { ... } );
-
key: string
The key of the Variable.
-
defaultValue: number
The initial default value of the variable.
-
OPTIONAL
limitedToValues: number[]The optional array of allowed values.
-
OPTIONAL
callback: functionThe callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument.
Returns NumberVariable
Adds a range Variable to array of Variables with optional callback.
remixer.addRangeVariable(key, defaultValue, minValue, maxValue, increment);
remixer.addRangeVariable(key, defaultValue, minValue, maxValue, increment, callback(variable) { ... } );
-
key: string
The key of the Variable.
-
defaultValue: number
The initial default value of the variable.
-
minValue: number
The allowed minimum value of the variable.
-
maxValue: number
The allowed maximum value of the variable.
-
increment: number
The amount to increment the value.
-
OPTIONAL
callback: functionThe callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument.
Returns RangeVariable
Adds a string variable to array of variables with optional callback.
remixer.addStringVariable(key, defaultValue);
remixer.addStringVariable(key, defaultValue, limitedToValues);
remixer.addStringVariable(key, defaultValue, limitedToValues, callback(variable) { ... } );
-
key: string
The key of the Variable.
-
defaultValue: string
The initial default value of the variable.
-
OPTIONAL
limitedToValues: string[]The optional array of allowed values.
-
OPTIONAL
callback: functionThe callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument.