Great bit of work - thanks, I found that this code works for me really well to support many types of Web Browsersrobi wrote:The camera uses an ActiveX control to display image in browser.
I downloaded it from the camera (the url is http://xxx.xxx.x.xx/IPCamPluginMJPEG.cab), unpacked it with WinRAR, registered the IPCamPluginMJPEG.ocx with regsvr32.
And guess what? It works! No username or password required.
.
Code: Select all
<html>
<head>
<title>Girton Sailing Club - Live Streaming Web Cam 2</title>
</head>
<body>
<center>
<h2>Girton Sailing Club - Live Streaming Web Cam 2</h2>
<SCRIPT LANGUAGE="JavaScript">
// Set the BaseURL to the url of your camera
// Example: var BaseURL = "http://girtonsc.homeip.net:8080/";
// Since this file is located inside the unit itself, no base url is specified here
var BaseURL = "http://guest:gsc2006@girtonsc.homeip.net:8080/";
// DisplayWidth specifies the displayed width of the image.
var DisplayWidth = "640";
// DisplayHeight specifies the displayed width of the image.
var DisplayHeight = "480";
// This is the filepath to the video generating file inside the camera itself
var File = "mjpg/video.mjpg";
// No changes required below this point
var output = "";
if ((navigator.appName == "Microsoft Internet Explorer")&&(navigator.platform != "MacPPC")&&(navigator.platform != "Mac68k"))
{
// If Internet Explorer for Windows then use ActiveX
output = "<object classid="clsid:B015B944-7316-49AE-AC84-ACCA9379EA32" id="IC1500PlugIn1" width="611" height="585">"
output += "<PARAM name="IP" value="girtonsc.homeip.net">"
output += "<PARAM name="Port" value="5005">"
output += "<PARAM name="Code" value="A99EDF974454FAA3311AA56046AE">"
output += "<BR><B>ActiveX Camera Control</B><BR>";
output += "................................. ";
output += "................................. ";
output += "................................. ";
output += "<BR></OBJECT>";
}
else
{
// If not IE for Windows use the browser itself to display
output = "<IMG SRC="";
output += BaseURL;
output += File;
output += "?dummy=garb" HEIGHT="";
// The above dummy cgi-parameter helps some versions of NS
output += DisplayHeight;
output += "" WIDTH="";
output += DisplayWidth;
output += "" ALT="Moving Image Stream">";
}
document.write(output);
</SCRIPT>
<!-- End of image display part -->
</CENTER>
</BODY></HTML>
What would be fantastic is if the IPCamPluginMJPEG.cab activex control could be offered as an install to the user when they go to the web page.
I was planning on hosting the IPCamPluginMJPEG.cab file somewhere and pointing my html to the location of it.
Sadly my skills are not up to that and google is failing me.
Help really appreciated to get me over this final stage.
Current Web Cam page is here if anyone wants to test it:
http://mardibloke.co.uk/gsccam2.html