Media Display
Use the Media Display control Presentation to convert a JSON-encoded URL into media content that can be shown within a User Control Interface (UCI). This is useful for displaying media content that updates frequently.
Currently, Media Display can show a PNG, JPEG, or GIF image in its original aspect ratio and can be optionally refreshed based on a set number of seconds. Video is not supported.
URL Requirements
-
The specified media URL must be accessible to the device on which the UCI is displayed – TSC touch panel, PC running Windows UCI Viewer, etc.
-
The URL must support secure HTTPS if the UCI will be viewed in Core Manager or Enterprise Manager.
-
Only a single URL is currently supported.
JSON Parameters
The JSON code must be in this format:
{ "Protocol": "Image", "URLs": [ "https://<myurl>" ], "ImageTimeSeconds": 1.0 }
Where:
-
"Protocol"
: Always"Image"
. No other format is supported. -
"URLs"
: A URL that includes a supported media type. -
"ImageTimeSeconds"
: Optional. A double value that specifies how often, in seconds, the image is refreshed – for example,2.0
,4.5
,0.5
. If omitted, the URL will load once when the UCI starts.
-
Create a text edit control – for example, with Custom Controls – and drag the new control it into the schematic. The Text Field Presentation will default to Text Field.
-
Press F6 to emulate the design.
-
Click the control text box and paste the JSON code for the media URL into the text box. Press Enter.
-
Press F7 to stop emulation.
-
Select the control text box again and change its Presentation in Properties to Media Display. If the URL is valid and contains a compatible media type, the text box changes to the media.
-
Drag the control into your UCI.
In this example, a Custom Controls component is configured with a Text edit control. The control contains the JSON-encoded media URL and has been dragged into the schematic twice: the top text box presentation is Text Field while the bottom is Media Display. The JSON specifies to display the image located at "https://placekitten.com/200/200" with an image refresh every second.
"No imaging component suitable to complete this operation was found"
If the text box is displaying this message, it means that the referenced URL is not displaying a supported media type. See Media Support.