QC control through browser window

volkerk's picture

Maybe someone is able to help. I would like to control a QC composition from Safari by sending commands through the web site's java script to QC. The site is based on the Google Maps API and shows a map where you can click and the latidude/longitude which I can get through Maps API should be forwarded to QC. How would I go about this?

smokris's picture
Re: QC control through browser window

From JavaScript code in the browser, call the setInputValue method on the embedded QC widget.

See Apple's documentation on QC WebKit for more info.

volkerk's picture
Re: QC control through browser window

The QC widget is great if you want to display QC compositions within a browser, but can you pass parameters from the browser to QC app running the composition? There is the Network Receiver patch, but I don't know how I would send parameters from the website running in safari to the network receiver.

smokris's picture
Re: QC control through browser window

Oh, I misunderstood. You want to send data from the browser to a composition running outside the browser. Interesting.

The Network Broadcaster and Network Receiver patches send and receive strings via UDP (though not raw strings: apparently they're padded to 128 bits for some reason..).

If you could send UDP packets from the browser, this could be useful. AFAIK you can't do this with normal browser-based JavaScript, nor can you do it from a Flash applet (use of UDP in Flash appears to be restricted to VoIP).

From a Java applet, however, you can send UDP packets. I've attached a quick example, based on the example at http://www.cs.utk.edu/~lchen/software/java/udping/ . Note that the applet has to be signed (even just self-signed) in order for UDP transmission to work.

You should then be able to control this Java applet using JavaScript within the HTML page.

PreviewAttachmentSize
UDPEchoClientApplet.java2.14 KB
UDPEchoClientApplet.png
UDPEchoClientApplet.png89.47 KB

volkerk's picture
Re: QC control through browser window

thanks smokris. i give it a try and will report back