Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Trying to control a webcam

Posted on 2005-03-17
7
Medium Priority
?
510 Views
Last Modified: 2008-02-01
I am trying to control a DLink DCS-900 (securicam)

I can get the camera running within HTML using the following code:
**************
<html>
<center>
<BODY scroll="no">
        <APPLET name="cvcs" CODEBASE="http://206.12.4.38:80/" CODE="xplug.class" WIDTH=320 HEIGHT=240>
          <param name="RemotePort" value=80>
          <param name="Timeout" value=5000>
          <param name="RotateAngle" value=0>
          <param name="PreviewFrameRate" value=2>
          <param name="DeviceSerialNo" value="bWNyZW5zaGE6MkR0VWlJ">
        </APPLET>
*********************

But what I'd like to do is be able to tell when i is connected or not, since it takes a long time to load sometimes, I don't know if it's being slow, or actually disconnected.

IE, Id like the screen to show either "Loading..." or "Disconnected" untill the webcam pops up.

Any leads into how I might be able to do this would be awesme.


Here's the small bit of code D-link provides:
http://support.dlink.com/faq/view.asp?prod_id=1871&question=DCS-1000%20/%20DCS-1000W%20/%20DCS-900%20/%20DCS-900W

     
0
Comment
Question by:galneweinhaw
  • 5
7 Comments
 
LVL 3

Expert Comment

by:blaines
ID: 13571075
Unless you have the Java source code, you can't modify any "Loading" prompt or "Disconnected" inside the Java Applet.
0
 
LVL 3

Accepted Solution

by:
blaines earned 2000 total points
ID: 13571128
I use some software installed on my local machine to stream my webcam, none of this "REFRESH" every few seconds, but real streaming. The downside is the software I use is not free.

You can get it here for $39.95:
http://surveyor.com/

It's awesome, I use it and it streams GREAT!!! I'll even post the code I use to stream. It has a stop and start functionality. And you can also provide an image to be displayed when you are offline/disconnected. It's great stuff.



-----------------------------------------------------------------------------------
<html>
<HEAD>
<TITLE>Web Cam</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>
<BODY BGCOLOR=#000000>

<div align="center">
            
<script LANGUAGE="JavaScript">
<!--
browserType = navigator.appName;            
newImage = new Image();
document.onstop = document_onstop;

function startstop_onclick()
{
      if (startstop.value == "-- click here to STOP the cam --")
      {
            stopLoad();
      }
      else
      {
            startstop.value = "-- click here to STOP the cam --";
            newImage.onload=loadNewImage;
            loadNewImage();
      }
}

function document_onstop()
{
      stopLoad();
}

function stopLoad()
{
      newImage.onload="";      
      startstop.value = "-- click here to START the cam --";
      window.status = "Live video stopped ...";
}

function loadNewImage()
{
    uniq = new Date();
    uniq = uniq.getTime();
    document.images.webcam32.src=newImage.src;
    newImage.src="http://127.0.0.1:8888/video/pull?"+uniq;
    window.status = "Displaying live video ...";    
}
function initialImage()
{
      uniq = new Date();
      uniq = uniq.getTime();
      newImage.onload=loadNewImage;
      newImage.src="http://http://127.0.0.1:8888/video/pull?"+uniq;
    document.images.webcam32.onload="";
}

function imageError()
{
      window.status = "Sorry ... we're not online right now";
      image = document.images.webcam32;
      image.onload = "";
      image.onerror = "";
      startstop.disabled = true;
      document.images.webcam32.src = "/images/spacer.gif";
}

if (browserType == "Netscape")
{
      document.write('<IMG SRC="http://http://127.0.0.1:8888/video/push" width=320 height=240>');
}
else
{
      document.write('<IMG SRC="http://http://127.0.0.1:8888/video/pull" name=webcam32 onload="initialImage()" onerror="imageError()" width=320 height=240>');
}
//-->
</script><br><INPUT id=startstop type=button value="-- click here to STOP the cam --" LANGUAGE=javascript onclick="return startstop_onclick()"></div>
</BODY>
</html>
-----------------------------------------------------------------------------------
0
 
LVL 3

Expert Comment

by:blaines
ID: 13571149
I forgot to add. The code I posted above will only work if you have the WebCam32 software installed.

http://surveyor.com/

BTW, I don't work for or get paid for this, I'm just posting what I personally use since it does exactly what you are trying to do.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:galneweinhaw
ID: 13572440
Thanks for the help!

Is there any way I can confirm this will work with my particular webcam?
0
 
LVL 3

Expert Comment

by:blaines
ID: 13575927
Not sure how to confirm, however, this program has worked on 4 different web cams I've owned. This program also detected my TV Tuner card which allowed me to broadcast a television show through my web cam site. I feel very confident it'll work for your web cam.

Here is how you can be sure:
http://surveyor.com/support/webcam32help/multimedia.html
0
 
LVL 6

Expert Comment

by:PreachDotNet
ID: 13576005
Windows Media Services 9 is free and can stream audio, movies, or live cam over the web.  

http://www.microsoft.com/windows/windowsmedia/9series/server.aspx

Its very easy to set up and works a treat.  Handles buffering etc for you.  I guarantee you'll have it up and running in an hour.
0
 
LVL 3

Expert Comment

by:blaines
ID: 13576352
I was unable to find out how to set up the M$ Media server to stream to my web cam site. Where do I get the Java or HTML code to make this stream work? I'm interested in testing it.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Strategic internal linking is often considered an SEO power technique, especially for content marketing. Do you need to hire an SEO agency to optimize you internal linking? No, this article will help you understand the basics of internal linking and…
No other job is as rewarding and demanding as building an iPhone app is. It is not really in the hands of the developer for the success of an iPhone app. Many factors operate jointly for every iOS application's success in the market.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses
Course of the Month14 days, 20 hours left to enroll

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question