Learning HTML by yourself


D - Putting in an Audio file.

11/11/2011 18:53

You can put in music to any web site but when you do that you need to put a controller on it.  Below is the code to put in a song called my song.  It only has the song, nothing else.  The code word embed does it.

 

<embed src="my song.mid" />

<p>Above is an embedded media player.  To stop the music press stop/pause.</p>

The Embed attribute has a number of ways to customize the appearance of the media player.  They are the following:

  • width - the width of the media player.
  • height - guess what this one does?!!
  • hiddn - if this value is true then the media player will not be displayed and the music plays without the person visiting the site having the ability to lower volumn or stop the music.  I do not recomment that one.

 

<embed src="my song.mid" width="320" heights="120" />

<p>Above is an embedded media player.  To stop the music press stop/pause.</p>

Other attributes are:

  • autostart - plays the song right away
  • loop - so the song repeats ornot
  • volume - to set the range of volumn from 0 - 100

 

<embed src="mysong.mid" autostart="false" loop="false"
volume="60" />

go to youtube, find a video with music, go to www.keepvid.com and put in the link of the video, and you have the ability to get the mp3 of the video to use in your web site.  Try it.

 

—————

Back