Interactions
Interactions make a template react while it plays, without any code. You connect an event, such as a tap on an item, a key press or a period without activity, to one or more actions that show or hide items or change a state.
The Interactions button in the Template Creator toolbar needs the Interactions permission, which is not part of the standard user profiles, and can be turned on by Smartsign support, or by the Server Admin for on premise installations. In the user profile, the permission is under Media.
Create an interaction
- Open the template in the Template Creator and click Interactions, the hand icon in the toolbar. The Interactions panel opens with events on the left and actions on the right.
- Click New event, choose the event type, fill in its setting if it has one, and click Add.
- Click New action, choose the action type and the item or state it changes, and click Add.
- Click the link button on the event (Link action), then the link button on the action (Create link). A line now connects them.
- Close the panel and click Save to save the interactions with the template.
One event can be linked to several actions, and one action can be linked from several events. Drag the boxes to arrange them.
To show a menu only when someone taps a button, link On start to Hide the menu, and Click item on the button to Show the menu. Link Inactivity with 30 seconds to Hide the menu, so it closes again when nobody uses the screen.
Events
| Event | Happens when |
|---|---|
| On start | The template starts playing. |
| Click item | Someone clicks or taps the selected item. Channel areas, smart media, webpages and video streams can't be selected, and a hidden item can't be tapped. |
| Key press | One of the entered keys is pressed. Separate several keys with spaces, for example a b Enter. Upper and lower case are treated the same. |
| Inactivity | Nobody has used the screen for the entered number of seconds. |
| State set to TRUE, State set to FALSE | An action sets the state to that value. The event also happens at start if the state's default value already matches. |
| Webhook | The selected webhook data source receives a request. |
To use Webhook, first create a Webhook data source under Templates -> Datasources. Only screens that are playing the template when the request arrives react to it.
Actions
| Action | What it does |
|---|---|
| Show, Hide | Shows or hides the selected item. Any item can be selected, including channel areas. |
| Toggle visibility | Hides the item, or shows it again if an interaction has hidden it. |
| Set State to TRUE, Set State to FALSE, Toggle state | Changes the value of the selected state. Events that use the state react to the change. |
States
A state is a named true or false value that you can use to build flows with several steps, for example to remember whether a menu is open. Click States at the bottom of the Interactions panel, then Add state. Enter a Name, choose the Default value, True or False, and click Add. Create the state before you add an event or action that uses it.
Change or remove interactions
- To change an event or action, open its menu and click Edit.
- To remove an event or action, open its menu and click Delete. Its links are removed too.
- To remove a link, click the line.
- To remove a state, click States, open the state's menu and click Delete. The events and actions that use the state are removed too, without asking for confirmation.
If you delete an item from the template, the events and actions that use it are deleted as well.
When you select a single item that a Click item event or a Show, Hide or Toggle visibility action uses, the settings panel on the right has an Interactions section that lists them. Click Edit interactions to open the panel.
Test and play interactions
Use Preview to try the interactions in a browser tab. Click items and press keys as a viewer would. Inactivity counts from the last mouse movement, click, key press or touch. An Interactions debug panel shows how much time is left on each inactivity timer and the current value of each state.
Media created from the template keeps its interactions and runs them when it plays on a screen. On a screen, Inactivity happens again each time the period passes without activity.
Events that react to taps, keys or inactivity need a touch screen or an input device, and how the screen reports this input depends on the player. Test the template on the screen it is made for.