.wav files not playing in netscape 8.1

Need technical advice on coding your web pages? Covers HTML, JavaScript, CSS, and some server side technologies. Also the issue of some webpages not displayed well.

Moderator: Don_HH2K

regarding the use of the object tag

Postby dotnetrocks » Fri 20 Oct, 2006 3:37 pm

I popped in the object tag code to give it a try as my embed tag worked in IE6, firefox1.0.3, opera7 but didnt work in netscape8.1 and mozilla1.4

at that point stopped it working in all browsers except IE6, but then with IE, a message appeared everytime I refreshed the page saying --> Click OK to run activex control

Shoulda thought about that, why would we consider that for a public web site... I issue a play() method on hover (mouseover) events to play a short sound...

and it plays in firefox and IE... Im just gonna stick with that and not bother with expecting plugins or use of activex...

I dont normally use sound in a web page Ive created... would appreciate if anyone knows a better way to do it... web's been around a while, I expected to look up --> Javascript and play sound --> on the web and it would have been easy and standard by now...

heres my code example in case I did somethin wrong... currently I commented out the use of the object tag


<a href='pgServices.asp'><img id='imgB1'
language="javascript"
onmouseover="try { playsound('sHover'); } catch(e) { } return true"
title='Services'
alt='Services'
src='images/buttonServices.gif' alt='' border='0' /></a>


<embed src="sounds/balloon.wav" autostart='false' width='0' height='0' name="sHover" enablejavascript="true">
<!--
<OBJECT
name="sHover"
CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">
<PARAM name="src" VALUE="sounds/balloon.wav" />
<PARAM name="autoplay" VALUE="false" />
<PARAM name="controller" VALUE="false" />
<PARAM NAME="type" VALUE="audio/x-wav" />
</OBJECT>
-->

</body>
<script language='javascript'>

function playsound(soundobj) {
var thissound= eval("document."+soundobj);
thissound.Play();
}

</script>
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3
User avatar
dotnetrocks
new member
new member
 
Posts: 3
Joined: Fri 20 Oct, 2006 3:20 pm

Postby Don_HH2K » Fri 20 Oct, 2006 4:06 pm

The [tt]embed[/tt] tag isn't part of any official HTML standard; it was actually added by Netscape for use in their earlier (3.x/4.x) series of browsers.

Using an [tt]object[/tt] tag is a bit weird, because you need to make an assumption as to whether or not a user has a specific plugin installed. From the looks of your code, for that to work you'd need to install the QuickTime plugin to all browsers in question. To the best of my knowledge, this will only work if you install QuickTime after installing those browsers; otherwise, you'll need to go find them and copy them into your browser's /plugins directory.

To ensure some level of compatibility, I think that you can (without violating HTML standards) call multiple controls, and tell the browser to use whichever plugin it supports first; for example:

Code: Select all
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
codebase="http://www.apple.com/qtactivex/qtplugin.cab">
   <param name="src" value="sounds/balloon.wav">
   <param name="autoplay" value="true">
   <param name="type" value="audio/x-wav">
<object
classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
<param name="FileName" value="sounds/baloon.wav" />
</object>
</object>


This code would call the QuickTime plugin first, and if the browser can't open that, it'd try to open the Windows Media Player plugin instead. Of course, by doing this, you still rule out any player that isn't QuickTime, Windows Media Player, or isn't able to imitate one of either. Guaranteed, it'll eliminate the majority, but you'd still leave a few people in the dust.
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.2 x64; en-US; rv:1.8.0.7) Gecko/20060917 Firefox/1.5.0.7 (mmoy CE K8M-X19)
Laptop: HP Compaq nx6325 - Turion 64 X2 @ 2GHz, 2GB DDR2, 100GB HD, ATI Radeon X300, 15" LCD, Seven Pro
Handheld: Palm Treo 650 - Intel PXA270 @ 312MHz, 10MB RAM, 32MB flash, 2.7" LCD, Palm OS 5.4
User avatar
Don_HH2K
Moderator
Moderator
 
Posts: 5112
Joined: Sun 09 May, 2004 3:59 pm

concerning the object tag

Postby dotnetrocks » Fri 20 Oct, 2006 5:23 pm

thanks for the reply

I guess if my site was gonna concentrate on the sound aspect of it, like I wanted theme music in the background, or wanted to play a song by request, and/or was gonna consider givin controls for playin to the user... Id consider this more... but as for now...

I think avoiding any object tag makes more sense when its just a small effect to be played over some buttons when they're hovered... for a public site, so Im not requiring they have a plugin or activex enabled...

If it becomes more important to me, another consideration I guess could be making the buttons flash objects, but not sure if these days, they'll operate correctly in IE without clicking on them first...

but the embed tag (even while it is old,) is currently working for IE and firefox... that should cover the majority alone...

I tried bgsound tag before, that worked in IE, but had heard was an IE-only tag so far...

the bgsound tag sounds like the thing I would have expected all browsers to have adopted because the idea of the tag should be an old one, having been there since the explosion of the web, when everyone was creating those java applets for animation and sound...

but thats my thought... its been really a slow and painful process to getting rich UI's to the browser, beyond simple hyperlinked documents with pictures, and in a standard way...

anyways, thx again for the reply
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3
User avatar
dotnetrocks
new member
new member
 
Posts: 3
Joined: Fri 20 Oct, 2006 3:20 pm

ps - about the embed tag in netscape

Postby dotnetrocks » Sat 21 Oct, 2006 11:46 am

after taking what I thought would be one last look at it, learned one thing new about it... it partially worked in netscape 8.1... if I gave the embed tag a width and a height substantially larger than 0px each, I would see a player object with a play and stop button, and could click play on it to hear my short (wav file) sound effect... even though I had an attribute on the tag called enablejavascript=true... seemed netscape8.1 by default wasnt allowing scripting of the object still, which was what I was tryin to do all along, at some point I'll possibly look back it... but...

to say it wasn't working wasnt entirely true, perhaps a security feature in the browser has scripting turned off on the object, no matter what that attrib setting was...

my concern is with defaults for catching the wide audience... so if netscape users can not hear the sound by default, then oh well...

that's the nature of the beast
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3
User avatar
dotnetrocks
new member
new member
 
Posts: 3
Joined: Fri 20 Oct, 2006 3:20 pm

Previous

Return to Web Design and Page Coding

Who is online

Registered users: Google [Bot]

cron