[Pro] How do I use this code?

Hi,
I’m working on a site where the client would like to incorporate a web cam…They have gave me a bit of HTML code, I pasted the code into text edit to make an html page and uploaded to their server. Not sure where to go from here, as you can see the html code doesn’t render into a webpage, it still just displays as code.

http://glacierelectric.com/webcam.html

Thanks,
Rich


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I need to proof read these before I post…“They have GIVEN me a bit…”


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Easy enough, try this. If you go to Page > HTML Markup and choose Before paste in:

<script language="javascript">
function StartStreaming()
{
    //Connect to the camera.
    //The value 0:both audio and video streaming, 1:only video
streaming, 2:only audio streaming.
    dcs.LiveStreamIn(0);
}
</script>

Then click OK, then use an HTML Markup item, or Crowbar, to paste in:

<script language="javascript">
    document.write("<OBJECT ID=\"dcs\"
CLASSID=\"CLSID:721700FE-7F0E-49C5-BDED-CA92B7CB1245\" ");
    document.write(" codebase=\"/dcsclictrl.cab #Version=1,0,0,2125\"
");
    document.write(" style=\"WIDTH: 640; HEIGHT:480;\">");  
    document.write(" </OBJECT>");
       
    //set URL
    dcs.RemoteHost="69.145.163.182";
    dcs.RemotePort=80;
               
    //set proxy to follow IE Proxy setting.
    dcs.Proxy=dcs.GetIEProxy();
    dcs.ProxyPort=dcs.GetIEProxyPort();
    dcs.SpecifiedBypass=dcs.GetIESpecifiedBypass();
    dcs.UseBypass(dcs.GetIEBypassEnable());  
    dcs.UseProxy(dcs.GetIEProxyEnable());
   
    //set username and password
    dcs.Username="username";
    dcs.Password="password";
              
    //Specify which profile of video acquired by the object. Typically,
there are 4 profiles in a multi-profile camera.
    //dcs.ProfileID="1";
 
    //Specify the stream type of the assigned profile. Possible value
are: 0:MPEG4, 1:MJPG, 2:H.264.
    //User should check the stream type of each profile before connect
it.  
    //dcs.SetStreamType(0);
   
              
    // Start video stream
    window.setTimeout(´StartStreaming()´, 1000);
</script>

That should work.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Dan,
Thanks…but I was still unable to get it to work.
When using the crowbar method, on upload I get a message that says, “A surrounding tag could not be detected, the code was not added to the page.”
And when using adding the code via insert HTML markup, the page after uploading is just blank.
http://glacierelectric.com/webcam.html

There maybe some other things going on here as well, yesterday I could see their camera, if I plugged in the ip, http://69.145.163.182/ but now nothing is showing up.

I found a couple of user forms for this camera as well and will start digging through them to see if anything makes sense to me. Hope to get it figured out…the IT guy at this organization has an “Anything you can do, I can do better with Dreamweaver” attitude toward me and the whole website project.

Thanks again.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Try using a Markup item for the second blob of code, only use it this way:

Page / Insert / Markup Item.

Paste your code into the dialog, and Okay.

Look on your page for a 100px square box with a little H in the corner. Click on it and drag its corners to be the size and position you want for your webcam image.

And if ever you don’t see an output from document.write() in JavaScript, then look at your page HTML level. document.write() is not allowed in Strict DOCTYPEs, so change to Transitional and you should be fine.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walt,
I don’t see an option under Page for Insert/ Markup Item.
I can only find the Markup Item, via, Insert Menu.

Like I said though…I can’t see anything at , http://69.145.163.182/ right now anyway.

Out of curiosity could either of you guys try to take stab at creating the page? Just to see if the code actually does work in the hands people who know what they are doing. Obviously nothing permanent, just want to see if the code is valid.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

That host isn’t responding from here. Can you Pastie the code you’re generating? Preview locally in a browser, view source, select all, copy. Go to http://pastie.org and paste. Change the format picker to HTML/XML and press the Paste button. Post the URL you get back, and we can see the nicely-formatted source code and make suggestions.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

http://pastie.org/1005379

I created this page/code using the method the first method that Dan noted.

I’ve got a call in to the organization’s IT guy to see why, http://69.145.163.182/ (the webcam’s address) is not responding.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Go back to Dan’s message – you have something completely different pasted into Page / HTML Markup / Before /HEAD than he noted. You have to take out what you’ve got there at the moment, because not only is it 5 years out of date (no living copies of Mac IE to be found on the net) it also is injecting an Object tag into the head of your page, which will only annoy the browser and won’t actually do anything.

Paste in the code that Dan indicated for the Before /HEAD slot, and make sure than none of the other parts of the Page / HTML Markup dialog have anything in them.

As far as the server not responding, you’re right, that’s probably the IT guy at work. I just did a traceroute, and I get as far as your border router host-69-145-163-106.static.bresnan.net (69.145.163.106), and then incoming requests are denied. Is this meant to be an in-house thing? Maybe you can only access it from inside your firewall?

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walt,
Sorry about the mis-pasting of code.
Here it is again, http://pastie.org/1005463

But, I think will gather some more information from the IT guy about this before I keep pestering. I think the camera is mostly meant to be a security camera that has some web capabilities built into it. I will ask a some questions of the IT guy, get few curt replies and get back to you.

Thanks,


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Okay, this looks better, except for the line break between lines 35 and 36 (as seen in Pastie). That should be all one line, line 36 should be what 37 is at the moment.

Line 45 is missing the < to begin the script tag, and you should really use <script type="text/javascript"> rather than language=“javascript” the way you have it here – that’s an out-of-date way to signal the type of script, and along with being invalid, might be ignored by some browsers.

On line 46, you need to ADD a return before each document.write in that one long line. Line 64/65 has an extra line break, 68/69 and 70/71 have the same.

Finally, on line 76, you have back-ticks ` instead of single-quotes surrounding the function call.

Here’s a Pastie with everything corrected that I’ve noted here:

http://pastie.org/1005519

There’s some other configuration stuff in there – user and password and IP and port – that need to be made “real” if they’re not already. Check with your IT person about those.

Remember, if you can browse to the security camera’s IP address from your desk, then you should be able to see this page working from there. If the cam is locked away from everyone’s view (not just mine in the public internet) then you might not get any joy no matter what you do in your page. There might be a way to proxy this cam so the public can see it, though.

I recall having a feature like this on the intranet at an office I worked at. You could see who was at the front door (usually smoking) at any time. It used a Java applet that would routinely ball up my ancient Mac OS 9 browser.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

The IT guy repsonded, but didn’t give me much to go on

He did say that I should be able to access, http://69.145.163.182 that ip then asks for username and password, enter “test” (no quotes) as the username no password required…you should be able to see the camera. (I am to see it…I’m not part of their network).

It does ask for an applet, so it must be similar to the system you noted.

I think the ball has been punted by to me by IT, since his response to me included the tech support link for the camera.

Still gathering info. Like you noted, Walt, I’m not sure if the port, password stuff from the provided code is real or just sample…will contact the support people for the camera next.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

One more quick bit of info and then I’ve got to give it a rest for the day.
I have found out that the camera is a D-Link 3420.
Found their support page for streaming. The code here is totally different from the stuff I’ve been tinkering with.

Does this answer any questions?

http://www.dlink.com/support/faq/default.aspx?question=webpage


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

This looks like they intend the applet to only be used on a Windows PC
running IE. You could try making a regular applet tag out of this code
(get rid of all the document.write stuff) and see if it just works on
a normal browser. It might.

Walter

On Jun 15, 2010, at 2:09 PM, Rich Gannon wrote:

One more quick bit of info and then I’ve got to give it a rest for
the day.
I have found out that the camera is a D-Link 3420.
Found their support page for streaming. The code here is totally
different from the stuff I’ve been tinkering with.

Does this answer any questions?

http://www.dlink.com/support/faq/default.aspx?question=webpage


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options