Skip to content
This repository has been archived by the owner on Jun 3, 2022. It is now read-only.

Latest commit

 

History

History
228 lines (133 loc) · 5.68 KB

remixer-api.md

File metadata and controls

228 lines (133 loc) · 5.68 KB

Remixer API

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.


start STATIC

Appends the HTML iFrame to body of client app. Attaches key listener to toggle Overlay visibility.

Syntax

remixer.start();
remixer.start(remoteConfig);

Parameters

  • 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"
      ...
    };

Returns void


stop STATIC

Removes iFrame and attached key listener.

Syntax

remixer.stop();

Returns void


addBooleanVariable STATIC

Adds a boolean Variable to array of Variables with optional callback.

Syntax

remixer.addBooleanVariable(key, defaultValue);
remixer.addBooleanVariable(key, defaultValue, callback(variable) { ... } );

Parameters

  • key: string

    The key of the Variable.

  • defaultValue: boolean

    The initial default value of the variable.

  • OPTIONAL callback: function

    The callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument.


addColorVariable STATIC

Adds a color variable to array of variables with optional callback.

Syntax

remixer.addColorVariable(key, defaultValue);
remixer.addColorVariable(key, defaultValue, limitedToValues);
remixer.addColorVariable(key, defaultValue, limitedToValues, callback(variable) { ... } );

Parameters

  • 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: function

    The callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument.


addNumberVariable STATIC

Adds a number variable to array of variables with optional callback.

Syntax

remixer.addNumberVariable(key, defaultValue);
remixer.addNumberVariable(key, defaultValue, limitedToValues);
remixer.addNumberVariable(key, defaultValue, limitedToValues, callback(variable) { ... } );

Parameters

  • 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: function

    The callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument.


addRangeVariable STATIC

Adds a range Variable to array of Variables with optional callback.

Syntax

remixer.addRangeVariable(key, defaultValue, minValue, maxValue, increment);
remixer.addRangeVariable(key, defaultValue, minValue, maxValue, increment, callback(variable) { ... } );

Parameters

  • 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: function

    The callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument.


addStringVariable STATIC

Adds a string variable to array of variables with optional callback.

Syntax

remixer.addStringVariable(key, defaultValue);
remixer.addStringVariable(key, defaultValue, limitedToValues);
remixer.addStringVariable(key, defaultValue, limitedToValues, callback(variable) { ... } );

Parameters

  • 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: function

    The callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument.