PDA

View Full Version : Need help setting up Podcasting / Audio player


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.

mokujin
07-09-2014, 06:02 AM
Audio/Video are supported in HTML5, do you have this
<!DOCTYPE html> ?

http://www.w3schools.com/html/html5_intro.asp

K4GAP
07-09-2014, 06:07 AM
Audio/Video are supported in HTML5, do you have this
<!DOCTYPE html> ?

http://www.w3schools.com/html/html5_intro.asp

In the head of the page?
If so I have this ...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

mokujin
07-09-2014, 06:12 AM
In the head of the page?
If so I have this ...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Yes, in the head. You have HTML 4.1 ...

K4GAP
07-09-2014, 06:29 AM
So, should the first code I listed work? Because it's not for some reason.

Dave
07-09-2014, 08:27 AM
So, should the first code I listed work? Because it's not for some reason.

I think you have to change your existing doctype to the doctype mokujin posted.
So go to your style variable editor and change the htmldoctype value.