Check if HTML template is running

Hey there, I am trying to automate custom client with CasparCG HTML templates. Could anybody get me on the road how to correctly check if template is running. Now I’m doing it via html remote debugging option, but it loads computer a little bit, maybe there is another way to check it? Maybe via osc or reading some kind of text file? Thanks!

1 Like

One possible mechanism is using websockets.

You either include a websocket server in your custom client, or use a nodejs module that has a server and your client and the template communicate via the nodejs server.

The SVT client includes a websocket server, so you can examine the code on Github to see how this is done using commonly available library functions.

The HTML template then opens a link to your websocket server when it starts up, and an event is generated in the server on connection. You can now easily send JSON messages between the template and client, either to exchange data for display, or to implement a routine ping that checks for the continued operation of the link.

If I play xyz.html on layer 108

INFO 1

Command gives following response

201 INFO OK
<?xml version="1.0" encoding="utf-8"?>
<channel>
   <framerate>50</framerate>
   <framerate>1</framerate>
   <mixer>
      <audio>
         <volume>0</volume>
         <volume>0</volume>
         <volume>0</volume>
         <volume>0</volume>
         <volume>0</volume>
         <volume>0</volume>
         <volume>0</volume>
         <volume>0</volume>
      </audio>
   </mixer>
   <stage>
      <layer>
         <layer_108>
            <background>
               <producer>empty</producer>
            </background>
            <foreground>
               <file>
                  <path>xyz.html</path>
               </file>
               <paused>false</paused>
               <producer>html</producer>
            </foreground>
         </layer_108>
      </layer>
   </stage>
</channel>

And OSC gives following

/channel/1/stage/layer/108/foreground/file/path
xyz.html

Do you know if OSC gives big overload for server if I’ll do checking every 100 ms?

I think OSC is always ON on server.

I’ll give a try :wink: Thanks both!