How to Put a Web Cam on My Site

by Y.T. Lin

Whether it's for your 15 minutes or 15 days of fame, imagine streaming the shows that you are creating to the world. All that, while being your own director and also possibly teaching what you know to your viewers. Putting a webcam on your site is a great way to build followers that help increase your popularity on the Internet. There are two ways to stream your webcam online: use an external service or hand-code the script if you are proficient in HTML. Following the steps assumes you have connected a webcam to your computer.

Using External Streaming Provider

1

Join UStream (see the third link in Resources section). UStream is a free and widely used webcam streaming service.

2

Sign into your UStream account. Click on "My Shows" and choose "Create new standard show."

3

Pick your options on the appearing screen and then click "Create Show."

4

Select "My Shows." Create a new show title and save it in the list.

5

Copy, paste and save the provided script into your web page or blog page where you want the webcam streaming to appear. The script should be placed between the <body> and </body> tags.

6

Choose the new show you created from the "My Shows" list and turn on your webcam.

7

Press the "Allow" button when asked to link to your webcam.

8

Choose "Start broadcast" to begin the live webcam streaming that will appear on your website or blog where the script has been placed.

Streaming for Advanced HTML Users

1

Download the latest version of the Windows Media Player from the official Microsoft website (see the last link in the Resources section).

2

Follow the installation wizard for configuring and running the Windows Media Encoder on your computer.

3

Open your website's HTML page in a text editor such as Notepad.

4

Embed the following HTML scripts in your web page's text editor where you want the webcam streaming to appear: <!--- BEGIN PLAYER ---> <!-- webbot bot="HTMLMarkup" startspan ----> <object ID="MediaPlayer" Width="400" Height="320" CLASSID="CLSID:27P9f0042-J0M1-33U7-06SS-1571H50DDMW81" STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject" CODEBASE="http://activex.Microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"> <param name="autoStart" value="True"> <param name="filename" value="http://www.(your domain name here)"> <param NAME="ShowControls" VALUE="False"> <param NAME="ShowStatusBar" VALUE="False"> <embed TYPE="application/x-mplayer2" SRC="(your domain name here): (your port number here)" NAME="MediaPlayer" Width="(enter a value here)" Height="(enter a value here)" autostart="1" showcontrols="0"> </embed> </object> <!-- webbot bot="HTMLMarkup" endspan ----> <!--- end PLAYER --->

5

Match the display dimensions of your Windows Media Encoder session in Step 2's tag script where it says "Width" and "Height." The values should match so that your streaming images will not be distorted on the viewers' screen.

6

Add the Class ID, which is the name of your webcam folder on your hard drive in Step 2's script where it says "CLSID:."

7

Enter your domain name (where it says "enter your domain name here" in Step 2's script), which must match with what you registered with your hosting company.

8

Enter the port number (where it says "enter your domain name here" in Step 2's script), if any, given to your domain from the hosting company.

9

Save the changes made to your HTML page before closing the text editor page. The script on the page will detect a webcam connected to your computer.

10

Test the web page in a browser where the webcam streaming will appear.

11

Turn on your webcam and choose the "Video" option. Press "Play."

Still Image for Advanced HTML Users

1

Download and install the Windows Media Encoder software by following the on-screen instructions (see the last link in the Resources section).

2

Place the following HTML tags in a web page that you want to display "still" webcam image(s) instead of live streams: <meta http-equiv="refresh" content="45" /> <meta http-equiv="expires" content="0" /> The above tags should be placed between the <head> and </head> tags in your HTML document. This ensures your page reloads automatically and will not be cached on the viewer's computer. Also, the viewers will receive a new "still" image every time when they go to this page or press their browser's Refresh button.

3

Change the value for the "content" in the first line after the "refresh" attribute. The number represents "second(s)." The page should refresh to load a new image if the viewer does not leave your page when the time is up.

4

Write your image tag between the <body> and </body> tags in the HTML document; the way you would for other images. For example: <img src="webcamphotos106.jpg" width="250" height="250" border="1" alt="my still webcam 106" />.

5

Place the exact image size in the image tags, after checking what size your webcam captures. Never change the size using HTML code as the image will be grainy on the screen.

6

Save the HTML document and test it in your browser with the webcam on.

Items you will need

About the Author

Y.T. Lin has been writing articles professionally since 2008 and for other content websites relating to his field of expertise since 2004. Lin holds Bachelor of Fine Arts and Master of Arts degrees in graphic design and interior design, respectively, from the Academy of Art University in San Francisco. He is a professional digital graphic artist, interior designer and Web developer.

More Articles

Photo Credits