The article below will explain the possible ways to control OnTheAir CG remotely for third parties, or other users who want to know what kind of integration can be done.
If you want to control OnTheAir CG from OnTheAir Video or OnTheAir Node, this won't really help, and you should rather read the following articles:
- HOW TO: Control OnTheAir CG Server from OnTheAir Node
- HOW TO: Control OnTheAir CG Server from OnTheAir Video
Installing the example documents
In our OnTheAir CG webpage, go to the “Downloads” section. you will be able to install some example documents:
- Simple Projects: are as its name implies some simple project samples to show you what can be done
- AppleScripts: Are sample documents (CG project and AppleScript itself) to show how to control OnTheAir CG Server with AppleScripts
- HTML Pages: Are sample documents (CG projects and HTML pages) to show you how to control OnTheAir CG Server with the REST API
Just download the files, these will be available to use in your OnTheAir CG Server and Designer.
Controlling OnTheAir CG with AppleScripts
We won't give an extensive course on AppleScripts here, as there is a lot that can be done. We will just give you the basics, so you can create your own.
Install and configure OnTheAir CG Server
When you run the installer with the option to install the AppleScripts example, this will install 4 documents in the Applications folder:
- one CG project and one AppleScript for basic examples
- one CG project and one AppleScript for a "Score and Counter" example
Once installed:
- Start OnTheAir CG Server and configure the playback settings so you can see the output of OnTheAir CG Server. If you don't have a video device to test, you can use the same trick that is explained with the direct link here.
- Make sure that "AppleScript Remote Control" is enabled in the "OnTheAir CG Server Settings > General":
Use the examples provided
To test the examples provided:
- Open the sample projects in OnTheAir CG Server
- Start them
- Then start the AppleScript
AppleScript Examples Project
With that AppleScript you will then see the text on screen being modified, and then later on the shapes moving. If you look at the AppleScript itself, you will see some explanations of what is done, but it should be easy to "read".
This is quite a simple AppleScript, and there are many things that can be done. To have the complete dictionary, the easiest is to either drag and drop the OnTheAir CG Server application on the application "Script Editor", OR in the application "Script Editor" select the menu "File > Open Dictionary..."
ScoreAndCounter Project
This project show how to have a simple counter in OnTheAir CG. The time will count up, but you can modify it to do a count down if that is what you need.
Controlling OnTheAir CG from any Browser
The sample HTML documents provided are a good base for you to know how this works. You can have a web developer start from there and adapt the page to fit your needs. Don't hesitate to ask us questions if you have.
Install and configure OnTheAir CG Server
For this example, you will need to enable the option "HTML Pages (REST API)" when running the OnTheAir CG Installer. This will install a few documents.
once installed:
- Start OnTheAir CG Server and configure the playback settings so you can see the output of OnTheAir CG Server. If you don't have a video device to test, you can use the same trick that is explained in that article.
- Make sure that "HTTP Remote Control" is enabled in the "OnTheAir CG Server Settings > General":
- You may also want to check which port number should be used (we would recommend to keep 2001), and define a new password (the default password is 1234).
- If you enable the option to "Publish all items", all the items within the CG projects will be modifiable by the API and will be listed. So we do not recommend enabling this option.
- Then you should enable the option "Custom Pages" and select the folder in which the HTML examples are located.
- Note that you must quit and restart OnTheAir CG Server to apply those changes.
You can then open the "Read Me" document that is located next to the HTML pages, to have further instructions on how the example projects work.
About the REST API
If you have a look at the code of the html sample page attached here, you will see that we use a REST API to communicate with OnTheAir CG Server. We use a few things here, but there are many other things that can be done. For the complete list of requests that can be done in REST, simply start a OnTheAir CG Server application, then on the same computer enter this url in Safari:
http://127.0.0.1:2001/api.html
The page that will open will show you all the instructions for the REST API protocol.
Comments
0 comments
Please sign in to leave a comment.