Check if ON AIR

ruimac

Member
Is there any other way to check if VIZ is ON AIR, besides System.SendCommand("MAIN IS_ON_AIR") ?

Because, when I use this command, a report, like COMMAND mapped to ID of "current session" (000001A01CB418A0) is sent to the Console.
And, since I'm checking this inside a OnExecPerField callback, the Console gets filled with there reports.
So, is there any other way to check if VIZ is ON AIR, without getting feedback in the Console?
 
I don´t think the COMMAND mapped to ID of "current session" (000001A01CB418A0) is because of the command, but because of a low performance on Viz Engine.

I recommend you getting out of the OnExecPerField function and using some other solution.
 
When I comment out the System.SendCommand("MAIN IS_ON_AIR"), the message stops appearing in the Console. That is why I assume it results from the command.
And, unfortunally, I really need it to be inside of an OnExecPerField callback.
 
To get onair status you can use Engine REST API:

rest1.JPG

rest2.JPG

Code:
Dim host, cmd, response As String
Dim data As Array[string]

Sub OnInitParameters()
    RegisterParameterString("host", "REST Webservice Host: ","127.0.0.1", 14, 20, "")
End Sub

Sub OnInit()
    host = GetParameterString("host")
    cmd = "GET /api/v1/renderer/onair HTTP/1.0\r\nHost: " & host & "\r\n\r\n"
End Sub

Sub OnExecPerField()
    response = System.TcpSend(host, 61000 , cmd , 900)
    response.Substitute("\r\n\r\n", "|", true)
    response.Split("|", data)
    If data.Size = 2 then
       println data[1]
    End If
End Sub
 
Thank you, mlynarik.jozef

So, if I create a script that checks for the ON AIR state using this method, the Engine REST API will have to be installed in each machine that opens the Viz files that use the script, right?
 
In that case, I can't use that method. I work on a TV station and not all computers with Viz will have that installed and I can't assure that my code would run on a machine with REST API installed.
 
In that case, I can't use that method. I work on a TV station and not all computers with Viz will have that installed and I can't assure that my code would run on a machine with REST API installed.
yes, this can be tough, but as I too work in a TV station, I recommand trying to get the REST install as standard, it can be very helpful for many things.
in my view, it's worth the hussle
 
In my view, also.
But the problem is to try to convince all the people responsible to do it and maintain it in all machines, including the ones in the regies.
 
In my view, also.
But the problem is to try to convince all the people responsible to do it and maintain it in all machines, including the ones in the regies.
there's not so much maintainae in that, it is mostly the first install that is a bit of clicks
 
there's not so much maintainae in that, it is mostly the first install that is a bit of clicks
The problem is to convince "the ones in charge" to do that in all machines, in a huge TV station where most people that are responsible for the decisions are affraid of changing things that are already "working fine" ;)
 
Back
Top