K4GAP
07-09-2014, 05:42 AM
I've been looking at different ways to add a small audio player at different places on my site. I am particularly interested in keeping it browser friendly.
Whether it's called an audio player or a podcast does not matter. It will consist of minimal controls and only show as a small this strip.
The code I tried to go with is missing something because it won't even show ...
<audio controls>
<source src="horse.mp3" type="audio/mpeg">
<source src="horse.ogg" type="audio/ogg">
<embed height="50" width="100" src="horse.mp3">
</audio>
What am I missing?
*Update
This code works ...
<object height="50" width="100" data="sample.mp3"></object>but, according to w3schools.com ....
Different browsers support different audio formats
If a browser does not support the file format, the audio will not play without a plug-in
If the plug-in is not installed on the users' computer, the audio will not playThat site says the best code to use is the first one I noted as not working.
Any help greatly appreciated.
Whether it's called an audio player or a podcast does not matter. It will consist of minimal controls and only show as a small this strip.
The code I tried to go with is missing something because it won't even show ...
<audio controls>
<source src="horse.mp3" type="audio/mpeg">
<source src="horse.ogg" type="audio/ogg">
<embed height="50" width="100" src="horse.mp3">
</audio>
What am I missing?
*Update
This code works ...
<object height="50" width="100" data="sample.mp3"></object>but, according to w3schools.com ....
Different browsers support different audio formats
If a browser does not support the file format, the audio will not play without a plug-in
If the plug-in is not installed on the users' computer, the audio will not playThat site says the best code to use is the first one I noted as not working.
Any help greatly appreciated.