Site icon David Yin's Blog

How to put music on a webpage

When I wanted to put a mp3 file on my BLOG, I met a problem. I can only put a link instead of a playing control panel.
Now, I got a way to make it works as what I want.

the embed html

below is the example html code for the embed tag

<embed src="soundfile.mid" hidden="false" border="0" width="310" height="45" autostart="true" autoplay="true" loop="true" volume="75%">

Break down of the example html source code shown as below:


how embed works
how the embed attributes work
src=”soundfile.mid” the url of the file
(src=”https://www.whatever.com/soundfile.mid”)
hidden=”false” shows the controls
hidden=”true” hides the controls
width=”310″ height=”45″
the dimensions of the control measured in pixels, play around with these
autostart=”true” autoplay=”true”
if set to true play automatically on load
autostart=”false” autoplay=”false”
if set to false do not play
loop=”true” if false play once only, if true repeat constantly
volume=”75%” set the volume as a percentage
Updated: 2005/11/18
For some people do not know how to put it into the MT blog. Check the Put the music file into blog.

Exit mobile version