0

I am trying to preload some sounds for a website I am working on... Originally I used the embed tag but that caused problems in Opera and did not validate... So I've switched to the object tag which now works in everything except IE8...

<object id="sound_lock" class="embedded" data="sounds/iphone/system/iphone_sound_lock.wav">
<param name="autostart" value="false" />
</object>

I had to put in a class to hide the sound files because tey were appearing with controls in Opera...

.embedded { visibility: hidden; }

Lastly here is the javascript code that plays the sound when required... Works in latest FF, Opera, Safari and Chrome but not in IE8... IE8 generates an 'object doesn't support this property or method' error...

var thisSound=document.getElementById(soundObj);
thisSound.Play();

I'm assuming this is because IE8 can't get the id from the object tag but can't find a work around... I want to make sure all the code validates appropriately so I am trying to avoid the embed tag...

Hope someone can help :)

4
Contributors
6
Replies
7
Views
7 Years
Discussion Span
Last Post by runey71
0

Are you using IE8 on Window 7? If so, the IE8 has some kind of problem playing sound. You could google and find how others discuss about this issue.

0

This is on Windows XP. I can make it work if I use embed tags instead of object tags. However that is not valid code and I'd rather not.

Haven't had much luck after hours if googling but I'll keep trying

0

IE sometimes(grin) needs a src parameter to understand the location.

<object id="sound_lock" type="audio/x-wav" class="embedded"  data="sounds/iphone/system/iphone_sound_lock.wav" />
<param name="autostart" value="false" />
<param name="src" value="sounds/iphone/system/iphone_sound_lock.wav" />
</object>

Ie sometimes need help to find its bum

Edited by almostbob: n/a

0

Thanks almostbob I'll try that out when I finish work... Fingers crossed :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.