EkoGroupController

EkoGroupController is UI controller used for controlling whether a UI element should be visible or not
at any given moment, based on the currently playing node and state of the variables plugin.
Upon creation it will be availalble on the globalState as globalState.ui.controllerId
For usage instructions see Showing/Hiding UI

Example (Creating a new group controller)


player.ui.addController('myController', 'GROUP',
 {
    showInNodes: {
        node_1: {
            showTime: 5,
            hideTime: 20
        },
        node_3: true
    },
    showIfVariables: {
        pastry: 'donut'
    }
});

Props

showInNodes
property

configure visibility based the currently playing node. Can be either:

Example (An array of node names)

showInNodes: ['node_15', 'node_4', 'node_8']

Example (An object where keys are node names and values are either boolean or objects)

showInNodes: {
    // Component will be visible during the entire duration of the node
    node_123: true,

    node_456: {
        // Can also be null, in which case component will be visible from the beginning of the node
        showTime: 12,

        // Can also be null, in which case component will be visible until the end of the node
        hideTime: 40
    }
}

showInVariables
property

Configure visibility based on variable state of the variables plugin.
Visibility is true if all variable conditions are true (AND) . Can be either:

Example (An object where keys are variable names defined by the variables plugin API and values are compared against the variable value)

showInVariables: {
    pastry: 'donut'
}

Example (A function that receives the variable value and returns true or false to determine visibility)

showInVariables: {
    // Component will be shown if the value of 'pastry' variable is either 'donut' or 'muffin'
    pastry: value => { return (value === 'donut' || value === 'muffin'); }
}
Rate this page: X
Tell us more!