Sign inSign up

dsigmund/turboplayer2sockets

By dsigmund

•Updated about 4 years ago

Tracks Turboplayer-Export-XML and presents the data with sockets.

Image
0

1.2K

dsigmund/turboplayer2sockets repository overview

⁠turboplayer2sockets

Tracks Turboplayer-Export-XML and presents the data with sockets.

⁠Deployment

To use it, you must mount a turboplayer.xml into the container and set some settings.

Example:

docker run \
--volume "${T2S_TURBOPLAYER_XML}":/opt/turboplayer.xml:ro \
--name turboplayer2sockets \
--restart unless-stopped \
-p "${T2S_PORT}":3000 \
-d dsigmund/turboplayer2sockets:latest
  • T2S_PORT: Port for the Service. (default: 3000)
  • T2S_TURBOPLAYER_XML: Where is the xml-file. (default: /opt/turboplayer.xml)

⁠Usage

There are two ways to get information: Sockets and a REST-API.

You may combine both methods, e.g. loading the present element on client start and then listening to changes on the sockets.

⁠Sockets

We are using socket.io⁠

In your HTML-File add the following snippet before the </body> (end body tag):

<script src="SERVER/socket.io/socket.io.js"></script>
<script>
  var socket = io();
  socket.on('present_update', function(item) {
    // Do something here with the new Item.
  });
  socket.on('error', function(item) {
    // Some Error on the Server occured. You might want to see this. Or not. Your Play
  });
</script>
⁠REST

Another Option is to use the REST-Paths:

  • /_health: Receive Status 200 if Server is Online
  • /_ready: Receive Status 200 if a present item is loaded, else 503
  • /_version: Backend Version as text/plain
  • /_config: Get the current config as application/json
  • /present: Load the present Item as application/json
⁠Present Item

The present item consists of the following fields:

  • sequence : The Current sequence. always present
  • Show_Name: The Name of the current show as string
  • Title: The Title of the current song
  • Music_Performer: The Performer of the current song
  • Time_Duration: The planned duration of the current song in MM:SS.fff

Example:

{
  "sequence": "present",
  "Show_Name": "Amsl Nicenstein",
  "Title": "Yarama Bastıkca",
  "Music_Performer": "Ah! Kosmos & Özgür Yılmaz",
  "Time_Duration": "00:04:23.000"
}

Tag summary

Content type

Image

Digest

sha256:793b6f88a…

Size

59.7 MB

Last updated

about 4 years ago

docker pull dsigmund/turboplayer2sockets