YosiFZ
YosiFZ

Reputation: 7890

Embed mp3 in html

I used this code for embed a mp3 file to html:

<EMBED SRC="mp3 link" HEIGHT=60 WIDTH=300>];

the problem is that the browser download the file and than he play it, there is any way for do it in buffer or something like this?

because i want the user will not wait.

Upvotes: 3

Views: 48365

Answers (3)

You
You

Reputation: 23774

Use the audio element of HTML5:

<audio src="[mp3 link]" preload controls></audio>

Upvotes: 3

Leopold Stotch
Leopold Stotch

Reputation: 1522

For browsers that support HTML 5 you can use this:

<audio src="song.mp3" controls="controls">
Your browser does not support the audio element.
</audio>

Otherwise you'd have to use JQuery as suggested above, or a flash audio player.

Upvotes: 17

Emil Condrea
Emil Condrea

Reputation: 9963

Google has a good player :

<embed type="application/x-shockwave-flash" flashvars="audioUrl=MP3_FILE_URL" src="http://www.google.com/reader/ui/3523697345-audio-player.swf" width="400" height="27" quality="best"></embed>

Upvotes: 5

Related Questions