/    Sign up×
Community /Pin to ProfileBookmark

Offline Webcam Default Image

I have the following applet to load a live streaming webcam image onto my webpage:

<applet codebase= “http://###.###.#.##:##/” archive=”wwCam.jar” code=”wwCam.class” width=”320″ height=”240″>
<param name=”filename” value=”http://###.###.#.##:##/ww.jpg” />
<param name=”copyright” value=”Copyright (c) 2003 Willing Webcam” />
</applet>

I am now trying to figure out how to put up a default image on the website when the camera software is off and I am also offline. The software doesn’t allow this option unless the software is still on (watermark) overlay. Anyone have any suggestions for a workaround? Would simple javascript suffice?

to post a comment
Java

8 Comments(s)

Copy linkTweet thisAlerts:
@TheBearMayMar 16.2006 — Assuming that the applet can't run if you're offline then this may work:

<i>
</i>&lt;applet codebase= "http://###.###.#.##:##/" archive="wwCam.jar" code="wwCam.class" width="320" height="240"&gt;
&lt;param name="filename" value="http://###.###.#.##:##/ww.jpg" /&gt;
&lt;param name="copyright" value="Copyright (c) 2003 Willing Webcam" /&gt;

&lt;img src="http://UrlToDefault.jpg" /&gt;

&lt;/applet&gt;
Copy linkTweet thisAlerts:
@smigsterauthorMar 16.2006 — Hmmm...

Tried it by uploading image to Photobuket, and doing as above, no workie...... ?

"Loading Java Applet failed"
Copy linkTweet thisAlerts:
@TheBearMayMar 17.2006 — Since Applet is depreceated anyway, might look to using the object tag and see if it works better for you.

<i>
</i> &lt;object classid="java:wwCam.class" type="application/x-java-applet" archive="wwCam.jar" codebase= "http://###.###.#.##:##/" height="240" width="320" &gt;
&lt;param name="filename" value="http://###.###.#.##:##/ww.jpg" /&gt;
&lt;param name="copyright" value="Copyright (c) 2003 Willing Webcam" /&gt;
&lt;img src="http://UrlToDefault.jpg" /&gt;
&lt;/object&gt;
Copy linkTweet thisAlerts:
@smigsterauthorMar 18.2006 — Well, it put the image up there...but now it's also there when the cam is on. This means I would have to change the webpage every time after I logged off. Not fun. ? Oh well, thanks for trying! ?
Copy linkTweet thisAlerts:
@TheBearMayMar 18.2006 — Strange..... it should have only displayed the image if the applet failed to load...
Copy linkTweet thisAlerts:
@smigsterauthorMar 19.2006 — Here is the code from the link from Overkill:

[B]

<applet codebase= "http://holla.no-ip.org/javacam/" code="JavaCam.class" width="320" height="240">

<param name="url" value="http://holla.no-ip.org/javacam/ww.jpg" />



<!-- Refresh every 5 seconds! must be the same as the interval

for the web cam image refresh because the applet detects web

cam inactivity by comparing the first 2 images to see if they're

identical. -->

<param name="interval" value="5" />



<!-- If the web cam is down, display this image -->

<param name="camdown" value="http://holla.no-ip.org/javacam/wwdown.jpg" />

</applet>[/B]



The webcam I have is a [U]live streaming[/U] one though. How do I configure the following code to work like the above? I am now getting the red x. Is this correct?

[COLOR=Red]<applet codebase= "http:xxx.xxx.x.xx:xx/" code="JavaCam.class" width="320" height="240">

<param name="url" value="http://xxx.xxx.x.xx:xx/" />

<param name="copyright" value="Copyright (c) 2003 Willing Webcam" />



<param name="camdown"

value="http://i58.photobucket.com/albums/xxxxx/xxxxxx/ccam.jpg" />

</applet>[/COLOR]


Very confused ?
Copy linkTweet thisAlerts:
@OverkillMar 19.2006 — 1) Download the applet class file:

http://holla.no-ip.org/javacam/JavaCam.class

2) Put that class file on your web server:

http://www.mywebsite.com/somefolder/[b]JavaCam.class[/b]

3) Create an html file to display the applet:

http://www.mywebsite.com/somefolder/[b]showapplet.html[/b]

4) Put this into your html file:

[color=red]Change the stuff in red[/color]
[CODE]
<applet codebase= "[color=red]http://www.mywebsite.com/somefolder/[/color]" code="JavaCam.class" width="320" height="240">
<param name="url" value="[color=red]http://www.mywebsite.com/ww.jpg[/color]" />

<!-- Refresh every 5 seconds! must be the same as the interval
for the web cam image refresh because the applet detects web
cam inactivity by comparing the first 2 images to see if they're
identical. -->
<param name="interval" value="[color=red]5[/color]" />

<!-- If the web cam is down, display this image -->
<param name="camdown" value="[color=red]http://www.mywebsite.com/wwdown.jpg[/color]" />
</applet>[/CODE]



----

Details
----


The web cam might be [b]live streaming[/b], but all its doing is replacing the [color=blue]http://www.mywebsite.com/ww.jpg[/color] with a newer image. Do you know how long the web cam waits before it updates [color=blue]http://www.mywebsite.com/ww.jpg[/color]?

Am I not understanding what's going on? lol
×

Success!

Help @smigster spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...