Updated 07/18/14 |
|
Streaming audio with the object tagIn this section I'll show you how to stream audio using the object tag. You can also use the bgsound and or embed tags to use music on your web pages however the W3C promotes using the newer object tag to use audio in your web pages. Below is my example of audio streaming "Hail to the Redskins" . For some reason the object tag doesnt work in FireFox so I'll use the embed tag for Firefox. Firefox (works in IE too) Now the IE version using the Object Tag
The best method is to use the embed tag because it works in all platforms and browsers. Note*** You can easily put the code in a JavaScript function for some kind of event handler Now here is the code using the object tag:
// This is where the size of the display and the audio selection is made and finally the code for the embed tag <embed src="http://www.cayemay.com/Hail.mp3"
autostart="false" loop="false"> Very short and simple the object and the parameters. There are many other parameters that you can use to manipulate your page you can find all of the parameters on the net or try searching the w3c website to find them. Sounds work funny ways in different browsers so make sure you test them in different platforms and browsers before uploading them to a live webpage. Now try replacing my audio file "Hail.mp3" with one of your own audio files to create your own web pages with audio. For question about this script or any other script on this website you can e-mail me webmaster@cayemay.com
|
This site was last updated 07/18/14