New data source type: local JSON file
The gist: the player listens to the data source (file) once every 10 seconds.
Attention! Only relevant for Windows player starting with version 4.3.8
Sometimes you need the player to take data from a local file and display the changed values in real time in an HTML page or widget. To do this, you need to create a data source of the file://... type.
(Картинка)
Both environment variables and absolute paths are allowed. Examples:
- file://%appdata%/visiobox/1.json
- file://C:/1.json
After the data source is created, you need to specify the resulting identifier in the JSON file.
File example:
{
"id": 521,
"data" : {
"d" : "Good evening"
}
}
In ID, you need to specify the identifier that was generated by the server when creating a new data source (section Settings-Data sources).
Next, when loading HTML or Widget, you need to connect the data source.
What will happen: the player will check for changes in the file every 10 seconds and the widget or html in the player will display data from the file.
Step by step:
- Create a data source. Source type "Player collects data itself". Specify the path to a file like file://C:/1.json
- Prepare HTML according to the recommendations or example above
- Upload it as a widget or HTML
- Connect a data source to it (specified during upload)
- Add the uploaded html to the playlist or bind it to the layout (if added as a widget)
Result (on the widget below)
(Картинка)