Add Multi-Media (Audio and Video) to Your Website Adding audio and video to your site isn't difficult but there are some things you need to be aware of before you do it. Firstly multi-media files can be very large and so you have to think carefully of how you make the files available. There are two ways of viewing video or listening to audio from websites. The most common way is to download the video/audio file to your own PC and use the appropriate program to play it. This is easy to implement as it involves a simple link and is very common for large files. Here is the HTML. <a href="examples/clock.avi"> Here is what the actual link looks like Click here to play a video file -if you click it it opens up an external application (windows media player) to display it. Another technique is to incorporate the video/audio into the webpage and is very common for smaller files, flash animations and streaming media files. There are two methods of doing this one using the embed tag (not standard but widely supported ) and the the other using the object tag (standard and recommended). Here is the HTML: For the embed tag: <embed src="examples/clock.avi" /> For the object tag: <object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95"> And here is what it looks like: Here is a flash example that uses the object tag The object and embed tag allow you to control the size of the inline object and whether the play auto starts and what controls are visible etc. For more information on the object and embed tags see the w3schools.com multi-media tutorial starting here but object tag described here.. Streaming Media Because multi-media files can be large it can take a long time to download the file to your PC before you can play file. Streaming is a technique for viewing video/audio content without having to download the entire file first. There are two methods of providing streaming media files. The most expensive one and only used by large site providing lots of media files is to use a special purpose streaming media server. The other method and the one for websites that aren't dedicated to providing multi-media files is to use a standard server and let the client on the user PC handle the streaming (so called pseudo streaming). Browser Plug-ins for Multi-Media A browser plug-in is a mini-application, usually free, that adds extra functionality to your Web browser, allowing it to perform functions (like displaying flash) that it couldn't previously do. Related Articles and Tutorials:
Click here to play a video file
</a>
<param name="FileName" value="examples/clock.avi" />
</object>
Sunday, December 23, 2007
Add Multi-Media (Audio and Video) to Your Website
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment