Problems playing sound

cecil
StarLounger
Posts: 98
Joined: 09 Sep 2010, 16:01

Problems playing sound

Post by cecil »

I am having trouble playing a sound in multiple browsers. I am having no luck with the object tag. Some web research tells me that the following should work.

<embed src="kevin-riley-tablesaw-accident.mp3" autostart="true" loop="false" height="45" width="180" controls="console">

Actually it works in IE and Firefox. However, when I change autostart to false, I cannot get the clip to play in Firefox. I also cannot get the controls to consistently show in Firefox. They will show when the mouse hovers, but otherwise, there is a safety cone on the page.

Thanks
Cecil

User avatar
HansV
Administrator
Posts: 74138
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Problems playing sound

Post by HansV »

What happens if you use

autostart="0"
Regards,
Hans

cecil
StarLounger
Posts: 98
Joined: 09 Sep 2010, 16:01

Re: Problems playing sound

Post by cecil »

Here is my code
_________________

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

<head>
<title>Tryme</title>
</head>

<body>

<p>this is a test 3 </p>


<p>Object 2</p>
<object data="sample2.mp3" type="audio/mpeg" width="280" height="30">
<param name="showcontrols" value="true" />
<param name="controller" value="true" />
<param name="src" value="sample2.mp3" />
<param name="autostart" value="1" />
</object>


<P>--------------------------------------</P>
<embed src="sample2.mp3" autostart="0" loop="false" height="45" width="180" controls="console">


</embed>

</body>
</html>

_________________
I changed autostart to 0 (zero) (I had already tried that), but I get the same behavior.

The object code works in Firefox this way. However, the object code does not work in IE. Even the object code fails in Firefox once I set autostart to true. Basically I get the same behavior in FF regardless of which tag, object or embed, I used.
<p>Object 2</p>
<object data="sample2.mp3" type="audio/mpeg" width="280" height="30">
<param name="showcontrols" value="true" />
<param name="controller" value="true" />
<!-- <param name="src" value="sample2.mp3" /> -->
<param name="autostart" value="1" />
</object>

User avatar
HansV
Administrator
Posts: 74138
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Problems playing sound

Post by HansV »

It doesn't work for me at all in Firefox. I get an information bar that an additional plugin needs to be installed. This turns out to be QuickTime, a plugin I neither have nor want.

Perhaps you could just insert a link to the MP3 file? This would open in the application the user has associated with .mp3 files.
Regards,
Hans

cecil
StarLounger
Posts: 98
Joined: 09 Sep 2010, 16:01

Re: Problems playing sound

Post by cecil »

here is my code. It does not work in Firefox with autostart set to False or 0 with either object or embed. Both work with autostart set to 1 or true. The object tag does not work in IE. I think I will try making this transitional instead of strict to see what I get.

Also, if I un-comment the src directive in the object param tag, FF also fails. It also fails if I use FileName instead of src.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

<head>
<title>Tryme</title>
</head>

<body>

<p>this is a test 3 </p>


<p>Object 2</p>
<object data="sample2.mp3" type="audio/mpeg" width="280" height="30">
<param name="showcontrols" value="true" />
<param name="controller" value="true" />
(!-- <param name="src" value="sample2.mp3" /> -->
<param name="autostart" value="1" />
</object>


<P>--------------------------------------</P>
<embed src="sample2.mp3" autostart="0" loop="false" height="45" width="180" controls="console">


</embed>

</body>
</html>

User avatar
HansV
Administrator
Posts: 74138
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Problems playing sound

Post by HansV »

I'm not an expert in web page design; hopefully someone else will have a more helpful suggestion.
Regards,
Hans

cecil
StarLounger
Posts: 98
Joined: 09 Sep 2010, 16:01

Re: Problems playing sound

Post by cecil »

Thanks Hans. I will do some more web searching tomorrow as well.