Posted: February 11 2003 at 09:25 | IP Logged
|
|
|
Ron,
No problem...it's actually quite easy. The first thing that I have is an index.htm in my web directory that details my framesets. The source is below:
<html> <head> <title>Dave Howard PowerHome Control Center</title> </head> <frameset cols="350,*"> <frameset rows="280,*"> <frame src= "webcam"><frame src= "></frameset> <frame src= ""></frameset> </html>
You can see that there are three framesets with three source files, 1 for the webcam, 1 for the webcam control, and 1 for the PowerHome main. The PowerHome main just loads the standard internal page. The webcam.psp is a very simple file that loads the Webcam32 java applet. Ive added some PSP code to determine whether the request is coming from my internal network or from an outside location so that the IP's are dynamically configured as either internal or external. The code for my webcam.psp is below:
<html> <head> <title>WebCam</title> </head> <body> <applet width="320" height="240" code="JavaCamPush.class" archive="JavaCamPush.jar" codebase="http://<%if(left(ph_getwebremoteip(),10) = "192.168.0.","INTERNAL_IP","EXTERNAL_IP")%>:8001/applet"><param name="cabbase" value="JavaCamPush.cab"><param name="URL" value="http://<%if(left(ph_getwebremoteip(),10) = "192.168.0.","INTERNAL_IP","EXTERNAL_IP")%>:8001"></applet> </body> </html>
The last source file is my camcontrol.htm. It doesn't require anything to be dynamic so it's just an HTM instead of a PSP. It uses the internal execsendkeys function to perform its actions. The code for it is below:
<html> <head> <title>Camera Control</title> <script language="JavaScript"> <!-- function sk(skvalue) { document.send_keys.sendkeys.value = skvalue;document.send_keys.submit(); } // --> </script> </head> <body> <form method="post" action="ph-cgi/execsendkeys" name="send_keys"><input type="hidden" name="sendkeys" value=""><input type="hidden" name="nexturl" value="/camcontrol.htm"> <input type="button" value="Living Room CAM" onclick="sk('ph_rtne(ph_x10(1,\'O\',2,0) + ph_x10(1,\'O\',102,0))')"> <input type="button" value="Ninja CAM" onclick="sk('ph_rtne(ph_x10(1,\'O\',1,0) + ph_x10(1,\'O\',102,0))')"> <input type="button" value="Cameras Off" onclick="sk('ph_rtne(ph_x10(1,\'O\',1,0) + ph_x10(1,\'O\',103,0))')"> <input type="button" value="Watch Camera" onclick="sk('ph_rtne(ph_macro(\'SET WDM CHANNEL 28\'))')"> <input type="button" value="Watch Satellite" onclick="sk('ph_rtne(ph_macro(\'SET WDM CHANNEL 20\'))')"> </form> </body> </html>
Let me know if you need any further help or explanations.
Dave.
|