D-Link Forums
D-Link IP Cameras for Home => DCS series Network Cameras => Topic started by: SandStorm on April 21, 2010, 06:27:08 AM
-
Hi,
I have a school set up with 5 DCS-2120's and 2 DCS-2121's.
Is it possible to have them embedded in the school's intranet website so the teachers can access the streams via their intranet site?
What code would I need to embed?
-
bump
-
I kind of figured it our myself: (my 2121's ip is 192.168.0.10). There is only one problem that it doesn't work for Internet Explorer. I still have to figure that out.
<p>
<object id="xplugApplet" classid="java:xplug.class" java_codebase="http://192.168.0.10" type="application/x-java-applet" archive="xplug.jar" name="xplugApplet" height="480" width="640">
<param name="archive" value="xplug.jar">
<param name="code" value="xplug">
<param name="codebase">
<param name="scriptable" value="true">
<param name="name" value="cvcs">
<param name="type" value="application/x-java-applet;version=1.6">
<param name="menuheight" value="40"> <param name="RemotePort" value="80">
<param name="Timeout" value="10000"> <param name="mayscript" value="true">
<param name="xmode" value="preview"> <param name="productID" value="DCS-2121">
<param name="profileid" value="3"> <param name="bg" value="0xd5dfea">
<param name="inittrigger" value="0"> <param name="imageWidth" value="640">
<param name="imageHeight" value="480"> <param name="webEvent" value="0">
<param name="pageContext" value="Basic YWRtaW46UHIxdmF0Mw==">
<param name="microphone" value="0"> <param name="speaker" value="0">
<strong> this browser doesn't support Java Plug-in. <br>
<a href="http://java.sun.com/products/plugin/downloads/index.html">
Get the latest Java Plug-in here.
</a>
</strong>
</object>
</p>
-
Hi Sandstorm,
Thank you for working this one out, it has been bugging me for a while, I wish I knew more about Java!.
Did you manage to work out the problem with Internet Explorer?
-
Hi rednblack,
I had the same problem - the SandStorm's script was not working in IE and it evoked this bug "java.lang.ClassNotFoundException: xplug"
The solution is to change
<param name="codebase">
to:
<param name="codebase" value="http://192.168.0.10">
or to:
<param name="java_codebase" value="http://192.168.0.10">
(URI from example, replace with your settings)
-
I have not yet solved this ... still looking into it.
To be honest, this currently is not on my list of high priority items.
I am struggling to get files stored on a network share to play back. (See other post of mine)
-
This code seems to be working for a DCS3410 as well, but I have a couple of questions.
1) Are there other parameters? The profile ID does not seem to work on a 3410 and I am try to lower the frames per second.
2) Before seeing a live image you must sign in. Is there a way arounf this?
Thanks for the help.
<p>
<object id="xplugApplet" classid="java:xplug.class" java_codebase="http://192.168.0.10" type="application/x-java-applet" archive="xplug.jar" name="xplugApplet" height="480" width="640">
<param name="archive" value="xplug.jar">
<param name="code" value="xplug">
<param name="codebase">
<param name="scriptable" value="true">
<param name="name" value="cvcs">
<param name="type" value="application/x-java-applet;version=1.6">
<param name="menuheight" value="40"> <param name="RemotePort" value="80">
<param name="Timeout" value="10000"> <param name="mayscript" value="true">
<param name="xmode" value="preview"> <param name="productID" value="DCS-2121">
<param name="profileid" value="3"> <param name="bg" value="0xd5dfea">
<param name="inittrigger" value="0"> <param name="imageWidth" value="640">
<param name="imageHeight" value="480"> <param name="webEvent" value="0">
<param name="pageContext" value="Basic YWRtaW46UHIxdmF0Mw==">
<param name="microphone" value="0"> <param name="speaker" value="0">
<strong> this browser doesn't support Java Plug-in. <br>
<a href="http://java.sun.com/products/plugin/downloads/index.html">
Get the latest Java Plug-in here.
</a>
</strong>
</object>
</p>
[/quote]
-
=======================================================================
http://tsd.dlink.com.tw/ for access to DCS920 1.04 firmware (i've not yet attempted on older DCS920)
I recommend using your countries support site for getting newest releases. N.America DLink doesn't have any knowledge of v1.04 on my DCS920, yet its on my newest DCS920 camera.
========================================================================
The following is what I've done for DCS920 camera, try it and perhaps you can figure out what you need to modify to make it work on the DCS2120/2121.
The following is NOT meant to be viewed with 3gpp, but I'm interested in knowing if it works.
I want 2120/2121 here in Canada, but its not available, as the 6111 is $1000= per unit, and is not economical for multiple deployments.
==========================================================================
Do a Find and Replace on these, replace with your relevant details
<title>Live View | Unit Identification XYZ</title>
this is the description in the camera
<body topmargin="1" leftmargin="0" rightmargin="0" bgcolor="#7531FB" onLoad="Init()">
bgcolor of FFFFFF will give you all white
<h1 align="center">SnapshotView Unit # XYZ <a href="Logout.htm">Logout</a></h1>
the Logout goes somewhere else
<td bgcolor=black><font color=white>DCS920 LocationRooftop<BR></font></td>
again a camera description
<APPLET name="cvcs" CODEBASE="http://aa.bbb.cc.dd:zzz/" CODE="xplug.class" WIDTH=640 HEIGHT=480>
<param name="RemotePort" value=abc>
<param name="Timeout" value=5000>
<param name="RotateAngle" value=0>
<param name="PreviewFrameRate" value=2>
<param name="DeviceSerialNo" value="YW46YWR5M=">
</APPLET> </td>
a couple things in this block of code
---the ip address of aa.bbb.cc.dd is your outside world IP presence (not 192.168.cc.dd)
---the :zzz/ after the IP address is the port address I've decided to use
(note you will need to have your outermost router, forward the port you choose to the cameras internal IP (192.168.etc)
---the WIDTH and HEIGHT is the output viewing window, not the size of the image
(if you have a 640x480 image in a 480x320 viewing window, you will only see a portion of the image, the image does not get resized, or cropped, just the window your looking through)
(its useful if you want to have a small image for seeing many cameras on one webpage, then just add a hyperlink to jump to the fullsized image)
---the RemotePort value of abc is whatever you set on the camera interface, mine matches the port address of zzz
---the Device serial number will likely be unique, just look at the source code of your DLink page (may need to be posted into a true html software to see this info
<img src="http://aa.bbb.cc.dd:zzz/image/jpeg.cgi" width="640" height="480"> </td>
if your running firmware version 1.04 (DCS920) then you can goto the Maintence>Device Management>Server Settings page and enable this
which will give you an instant freezeframe image (at the time the browser screen loads)
by throwing this on the same page as the live stream i can F5 to instantly grab what is showing in the live stream, then save it from anywhere remotely
I'm still trying to get DLink to tell me where I can download (ftp://ftp.dlink.com Multimedia / DCS920 / Firmware) the 1.04 version that is on my newly purchased DCS920, so I can update my older DCS920's.
END OF REQUIRED CHANGES TO BELOW CODE
====================================================================================================
====================================================================================================
<html>
<head>
<link rel="stylesheet" rev="stylesheet" href="dlink.css" type="text/css">
<title>Live View | Unit Identification XYZ</title>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<SCRIPT LANGUAGE="JavaScript">
function Init() {
if ((navigator.appName != "Netscape") &&
(navigator.userAgent.indexOf('Opera') == "-1"))
{
window.setInterval("ShowFrameRate()", 1000)
}
}
function ShowFrameRate() {
if (1)
{
var fFrameRate = cvcs.GetFrameRate()
window.status = "Frame:" + fFrameRate.toString() + " fps"
}
cvcs.GetRealTimeData()
CurrentTime.innerHTML = cvcs.GetTimeString()
}
</SCRIPT>
</head>
<body topmargin="1" leftmargin="0" rightmargin="0" bgcolor="#7531FB" onLoad="Init()">
<table border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#FFFFFF" bordercolordark="#FFFFFF">
<tr><td bgcolor="#000000"></td>
</tr>
<tr><td>
<table border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#FFFFFF" bordercolordark="#FFFFFF">
<tr>
<td height="420" valign="top" id="maincontent_container">
<div id="maincontent">
<!-- === BEGIN MAINCONTENT === -->
<div id="box_header">
<blockquote>
<h1 align="center">SnapshotView Unit # XYZ <a href="Logout.htm">Logout</a></h1>
</blockquote>
</div>
<div class="box">
<div align="center">
<table cellpadding="2" cellspacing="1" border="0" width="534" bgcolor="white" bordercolor="#FFFFFF">
<FORM ACTION="/Jview.htm" METHOD="POST">
<tr><td align="center">
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr>
<td bgcolor=black><font color=white>DCS920 LocationRooftop<BR></font></td>
<td bgcolor=black align=right valign=top> <font color=white><SPAN ID="CurrentTime"></SPAN></font></td>
</tr>
<tr>
<td colspan=2 align=center bgcolor="white">
<APPLET name="cvcs" CODEBASE="http://aa.bbb.cc.dd:zzz/" CODE="xplug.class" WIDTH=640 HEIGHT=480>
<param name="RemotePort" value=abc>
<param name="Timeout" value=5000>
<param name="RotateAngle" value=0>
<param name="PreviewFrameRate" value=2>
<param name="DeviceSerialNo" value="YW46YWR5M=">
</APPLET> </td>
</tr>
</TABLE>
</td></tr>
<tr><td> Zoom :
<INPUT type=button style="width:25px" value='x1' onClick="cvcs.Zoom(1)">
<INPUT type=button style="width:25px" value='x2' onClick="cvcs.Zoom(2)">
<INPUT type=button style="width:25px" value='x3' onClick="cvcs.Zoom(3)">
<INPUT type=button style="width:25px" value='x4' onClick="cvcs.Zoom(4)">
<img src="http://aa.bbb.cc.dd:zzz/image/jpeg.cgi" width="640" height="480"> </td>
</tr>
</table>
</div>
</div>
</form>
<!-- === END MAINCONTENT === -->
</div> </td>
</tr>
</table>
</td></tr></table>
</body>
</html>
-
After some time finding the bits and pieces then making it work, here's what I've come up with, and works for me just fine.
<script language="JavaScript">
<!--
if ((navigator.appName == "Microsoft Internet Explorer")&&(navigator.platform != "MacPPC"))
{
document.write("<OBJECT ID=\"VaCtrl\" WIDTH=362 HEIGHT=306");
document.write(" CLASSID=CLSID:361E6B79-4A69-4376-B0F2-3D1EBEE9D7E2");
document.write(" codebase=\"http://xxx.xxx.xxx.xxx/RtspVaPgDec.cab#version=2,0,0,16\">");
document.write("<param name=\"Url\" VALUE=\"rtsp://username:password@xxx.xxx.xxx.xxx/live.sdp\">");
document.write("<PARAM NAME=\"VSize\" VALUE=\"SIF\">");
document.write("<PARAM NAME=\"Language\" VALUE=\"EN\">");
document.write("<param name=\"ClientOptions\" VALUE=\"567\">");
document.write("This camera requires an ActiveX Plug-in to be installed. If you see this text, your browser is not supported or your computer has ActiveX disabled.");
document.write("<\/object>");
}
//-->
</script>
Replace:
xxx.xxx.xxx.xxx with the IP of your camera
username with the username you login with
password with the password to use
And you should be up and running!
-
...And you should be up and running!
Thanks a lot. I'm considering buying a DCS-2121 and streaming the video to a public website.
- Do you have an example of what your solution looks like on a website?
- Is there a limit on the number of people who can view the video stream at the same time?
Thanks in advance!