You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.
JoshSnider edited this page Apr 23, 2018
·
2 revisions
A single button may be seen by thousands of viewers. The action that button causes may not make sense to spam thousands of times per second so you may want to put buttons on a "cooldown" timer before allowing them to be pressed again. Take a look at this snippet:
// Look for a cooldown metadata property and tigger it if it exists.longlong cooldown = 0;
int err = interactive_control_get_meta_property_int64(session, "button1", "cooldown", &cooldown);
if (MIXER_OK == err && cooldown > 0)
{
interactive_control_trigger_cooldown(session, "button1", cooldown * 1000));
}
The code above assumes that you have added a metadata property to the button with the key "cooldown" and a number value that represents the number of seconds the button should cooldown after being pressed.