EMBEDDING MEDIA IN YOUR WEBPAGES


by Dr. Elizabeth Hanson-Smith

Embedded movies
Embedded sound files

Back to Tips and Tools
Back to Dr. Hanson-Smith's homepage






Adding embedded movies with controllers to your Webpage




Microsoft Internet Explorer no longer readily supports QuickTime movies, so you will need to do
a little fancy code to get most browsers to recognize your movie files.  You can also use a javascript
for this task, but this simple set of code seems to work:


<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="160"HEIGHT="144"
CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">
<PARAM name="SRC" VALUE="sample.mov">
<PARAM name="AUTOPLAY" VALUE="false">
<PARAM name="CONTROLLER" VALUE="true">
<EMBED SRC="sample.mov" WIDTH="160" HEIGHT="144" AUTOPLAY="false" CONTROLLER="true" PLUGINSPAGE="http://www.apple.com/quicktime/download/">
</EMBED>
</OBJECT>




Substitute your own file name for sample.mov above.

Also make sure your height value is set for 16 pixels more than your actual movie's size to allow room for the controller.

For a fuller explanation of the code, see Apple's page:

 http://www.apple.com/quicktime/tools_tips/tutorials/activex.html.


 





Here is another example, this time using RealOne Player, another popular free resource for playing media on the Internet:

<embed src="http://www.cit.cornell.edu/atc/itsupport/fac_profiles.ram"
 type="audio/x-pn-realaudio-plugin" controls="ImageWindow,ControlPanel"
 width="200" height="176">

This is how the Player will appear on your page:










Adding embedded sounds with controllers to your Webpage


The codes for sound control can be fairly simple, depending on what size or type you need, but some commands are not recognized by some browsers. (Thanks again, Bill...)

These are the simplest options I could find for the embedded controllers.

CLICK AND PLAY  -
the user has no control except through their own computer sound adjustments.
   When they finish, they close the window or click BACK.

Click here to play
<A TARGET="NEW" HREF="Rising_Sun.mid">
Click here to play
</A>

(You could also use an image to link to the HREF.)
BUTTON CONTROL - Users click to open their own browser's preferred player. May need some directions for downloading players such as Real Audio.
<FORM METHOD="LINK" ACTION="sugarsugar.mid"><INPUT TYPE="submit" VALUE="Play Audio"></FORM>

CONSOLE - the default opens a simple control panel



<EMBED ALIGN="CENTER" SRC="http://www.mountaindragon.com/html/cut1.mid" HEIGHT="60" WIDTH="145" AUTOSTART="FALSE" VOLUME="100%"></EMBED>

PLAYBUTTON -
an abbreviated version with no volume control


<EMBED ALIGN="CENTER" SRC="http://www.mountaindragon.com/html/cut1.mid" HEIGHT="23" WIDTH="35" AUTOSTART="FALSE" CONTROLS=PLAYBUTTON VOLUME="100%" </EMBED>
AUTOSTART & LOOP
when a page opens -
I DON'T recommend this option,
but if you use it, be sure to use a finite loop.
(Nothing shows on your page.)

(Don't drive your users nuts.)
<EMBED SRC="sample.mp3" HIDDEN="TRUE" AUTOSTART="TRUE"  LOOP="3" DELAY="3"></EMBED>


Notice that volume at 50% will be half of what users' settings are on their own computer. If you leave out this paramenter, the sound will play at the user's current setting.

For more on sound controllers see
     http://www.mountaindragon.com/html/sound.htm
     http://www.htmlcodetutorial.com/embeddedobjects/_EMBED_CONTROLS.html




Back to top