By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,002 Members | 2,157 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,002 IT Pros & Developers. It's quick & easy.

why is "how to play a sound with Javascript" such a rare topic?

P: n/a

I did a search on the newsgroup comp.lang.javascript. I was searching
for "how to play a sound with Javascript". I'm somewhat suprised that
the majority of entries are from the 1990s, and there are almost no
posts from the last 3 years:

http://groups.google.com/group/comp....rch+this+group

Even after sorting by date, there don't appear any entries more recent
than 2006, and there are only 3 from 2006.

If I were to chart the frequency of questions about sound on a graph,
it would appear there was great interest in the question during the
1990s, and then that interest faded away, disappearing almost entirely
after 2004.

Why is that? Did Flash become good enough and widespread enough that
programmers now rely on it completely when trying to get sound to play
on a site? Is there the sense that it is too difficult to use
Javascript to play a sound on a web page?

I was working on some Ajax chat software and I was asked to make a
sound play when someone posted a new message to a chat room. I was
thinking of doing this in a pure-Javascript way, but perhaps that is
to be advised against? Should I use Flash instead?

I asked my friends for a pure Javascript solution and they pointed me
to a script that still involves Flash:

http://www.boutell.com/newfaq/creating/scriptsound.html
Feb 26 '08 #1
Share this Question
Share on Google+
26 Replies


P: n/a
On Feb 26, 12:30*am, Jake Barnes <lkrub...@geocities.comwrote:
I did a search on the newsgroup comp.lang.javascript. I was searching
for "how to play a sound with Javascript". I'm somewhat suprised that
the majority of entries are from the 1990s, and there are almost no
posts from the last 3 years:

http://groups.google.com/group/comp....rch?group=comp...

Even after sorting by date, there don't appear any entries more recent
than 2006, and there are only 3 from 2006.
It is a rare Web page that needs to make use of sounds.
>
If I were to chart the frequency of questions about sound on a graph,
it would appear there was great interest in the question during the
1990s, and then that interest faded away, disappearing almost entirely
after 2004.

Why is that? Did Flash become good enough and widespread enough that
programmers now rely on it completely when trying to get sound to play
on a site? Is there the sense that it is too difficult to use
Javascript to play a sound on a web page?
Flash is not "good enough" for much of anything IMO. It is a rare Web
page that needs to make use of Flash.

There may be a sense that it is too difficult to play sounds with
JavaScript, but it is nonsense. The issues involved are virtually
identical to those involved with using Flash. The difference is that
there are tons of (incompetent) Flash scripts out there (most notably
the one provided by Adobe), but few that deal with audio plug-ins.
>
I was working on some Ajax chat software and I was asked to make a
sound play when someone posted a new message to a chat room. I was
thinking of doing this in a pure-Javascript way, but perhaps that is
to be advised against? Should I use Flash instead?
No, you had it right to begin with.
>
I asked my friends for a pure Javascript solution and they pointed me
to a script that still involves Flash:

http://www.boutell.com/newfaq/creating/scriptsound.html
Then they pointed you to an inappropriate script.

If you are writing an Ajax chat application, then you should be able
to tackle this. As with Flash, you need two branches, one that checks
the plugins and/or mimeTypes collections to determine support for your
chosen format and a fallback for IE and its various derivations (e.g.
old AOL browsers, which have no such collections (the feature
detection pattern should be obvious.)

The first branch adds an object element to the body to play a sound
and removes it after a suitable delay (which cannot be calculated
exactly as it takes time to download the file and load the plug-in.)
I use two object elements to allow for music and sounds to play
simultaneously. You can "preload" the plug-in with dummy (silent)
audio file(s) when the page loads, but still need to pad the duration
to allow time for the initial download.

The second branch adds a bgsound element (or two) to the head and
changes the src property to play sounds. You can actually preload the
sound files with this method as you can play sounds silently by
manipulating the volume property. This works much better than the
other method as you never have to remove the elements, so there is no
need to pad the play time.
Feb 26 '08 #2

P: n/a
SAM
Jake Barnes a écrit :
>
I asked my friends for a pure Javascript solution and they pointed me
to a script that still involves Flash:

http://www.boutell.com/newfaq/creating/scriptsound.html
It's the best.

Anyway it is impossible to play a sound in JS ...
a sound can only be played by a plug-in and there was so much plug-ins
to play sound whom each one with its proper JS commands, in these
conditions how to be sure to have thought to all of them?

Today it is not very important any more to use a heavy mp3 instead of
light midi
Flash play mp3 and can be driven via JS
Flash is present on 90% of home computers
so ... at this date ... it's the solution

--
sm
Feb 26 '08 #3

P: n/a
On Feb 26, 9:21*am, SAM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
Jake Barnes a écrit :
I asked my friends for a pure Javascript solution and they pointed me
to a script that still involves Flash:
http://www.boutell.com/newfaq/creating/scriptsound.html

It's the best.
How so?
>
Anyway it is impossible to play a sound in JS ...
a sound can only be played by a plug-in and there was so much plug-ins
to play sound whom each one with its proper JS commands, in these
conditions how to be sure to have thought to all of them?
You really don't have to consider the plug-in at all.
>
Today it is not very important any more to use a heavy mp3 instead of
light midi
Flash play mp3 and can be driven via JS
I didn't follow that, but you can certainly play MP3's using the
methods I described. In fact, they work best for longer clips as most
plug-ins will stream them.
Flash is present on 90% of home computers
That isn't a comforting statistic. And not all of those Flash
installations will support interaction with JavaScript.
so ... at this date ... it's the solution
Of course, there aren't any decent scripts out there for Flash.

Quoting the first two lines from the "SoundManager" script:

var isIE = navigator.appName.toLowerCase().indexOf('internet explorer')
+1;
var isMac = navigator.appVersion.toLowerCase().indexOf('mac')+ 1;

I stopped reading after that.

And it appears you have to convert every sound effect to MP3. On the
plus side, it is very responsive, but do you really need UI sounds in
a Web page? The OP just wants to sound a chime periodically.
Feb 26 '08 #4

P: n/a
On Feb 26, 10:53 am, David Mark <dmark.cins...@gmail.comwrote:
Flash is present on 90% of home computers

That isn't a comforting statistic. And not all of those Flash
installations will support interaction with JavaScript.
Nor does the presence of Flash necessarily mean that it's turned on. A
number of my colleagues (myself included) utilize a plugin that blocks
Flash from loading automatically (replacing it with the Flash icon so
we know it's there) unless we specifically click it to activate.
Feb 26 '08 #5

P: n/a
SAM
David Mark a écrit :
On Feb 26, 9:21 am, SAM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
>Jake Barnes a écrit :
>>I asked my friends for a pure Javascript solution and they pointed me
to a script that still involves Flash:
http://www.boutell.com/newfaq/creating/scriptsound.html
It's the best.
Oooops!
I thought we told of this one :
<http://www.schillmania.com/projects/soundmanager2/>
issued from :
<http://www.schillmania.com/projects/soundmanager/>
(perhaps are they all the same ?)

(snip)
Quoting the first two lines from the "SoundManager" script:
I've seen that too :-/
var isIE = navigator.appName.toLowerCase().indexOf('internet explorer')
+1;
var isMac = navigator.appVersion.toLowerCase().indexOf('mac')+ 1;

I stopped reading after that.
I only have a look to the code after having pushed some of proposed
buttons in soundManager_1 that did noises (yes they did !)
And it appears you have to convert every sound effect to MP3.
And then ?
The sound has to be coded anyway (even it is a midi), no ?
On the
plus side, it is very responsive, but do you really need UI sounds in
a Web page? The OP just wants to sound a chime periodically.
I don't say the OP has to have its page to download an elephant if he
just needs a mouse.
I say only that soundmanager is the best (the easiest way) to serve sounds.
There are some others Flash mp3 players on the Net but most of them are
not so efficient (even if they probably be used too).
(I like this one : http://www.alsacreations.fr/dewplayer )

But I'am seriously very curious to see *with an example* how you do to
play a sound on demand (a "clic" when clicking a link for instance)
without using Flash and without downloading the sound each time.
Because personally I can't do it.

--
sm
Feb 26 '08 #6

P: n/a
SAM
Kevin Scholl a écrit :
On Feb 26, 10:53 am, David Mark <dmark.cins...@gmail.comwrote:
>>Flash is present on 90% of home computers
That isn't a comforting statistic. And not all of those Flash
installations will support interaction with JavaScript.

Nor does the presence of Flash necessarily mean that it's turned on. A
number of my colleagues (myself included) utilize a plugin that blocks
Flash from loading automatically (replacing it with the Flash icon so
we know it's there) unless we specifically click it to activate.
You're right.
I've recently downloaded a flash blocker.
And the JS also can be disabled too.

The Net will kill the Net ... :-(

Feb 26 '08 #7

P: n/a
David Mark wrote:
If you are writing an Ajax chat application, then you should be able
to tackle this. As with Flash, you need two branches, one that checks
the plugins and/or mimeTypes collections to determine support for your
chosen format and a fallback for IE and its various derivations (e.g.
old AOL browsers, which have no such collections (the feature
detection pattern should be obvious.)

The first branch adds an object element to the body to play a sound
and removes it after a suitable delay (which cannot be calculated
exactly as it takes time to download the file and load the plug-in.)
I don't see a need for removing the element, especially not because of
the uncertainty you mentioned.

Audio compression aside, I also don't see a need for Flash here. User
agents are capable to load the audio resource directly with the object
element. You will have to use another branch for MSHTML, though, that
uses a CLSID to trigger the Windows Media Player ActiveX control.
The second branch adds a bgsound element (or two) to the head and
changes the src property to play sounds.
There really is no need for that, unless you want to support IE 4.
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Feb 26 '08 #8

P: n/a
Thomas 'PointedEars' Lahn <Po*********@web.dewrites:
Audio compression aside, I also don't see a need for Flash here. User
agents are capable to load the audio resource directly with the object
element.
This is an unusually sweeping statement coming from you. My main browser
(firefox 2.something on debian) certainly doesn't play mp3s when they're
provided via an object tag.

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
Feb 26 '08 #9

P: n/a
On Feb 26, 6:17*pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
David Mark wrote:
If you are writing an Ajax chat application, then you should be able
to tackle this. *As with Flash, you need two branches, one that checks
the plugins and/or mimeTypes collections to determine support for your
chosen format and a fallback for IE and its various derivations (e.g.
old AOL browsers, which have no such collections (the feature
detection pattern should be obvious.)
The first branch adds an object element to the body to play a sound
and removes it after a suitable delay (which cannot be calculated
exactly as it takes time to download the file and load the plug-in.)

I don't see a need for removing the element, especially not because of
the uncertainty you mentioned.
You have to remove it, set the src property and re-add it to get a new
sound to play (at least in the browsers I have tested.) And then
there is the issue of fast history navigation. Leave the object in
place and the last sound played will play again when you return to the
page, which is very annoying.
>
Audio compression aside, I also don't see a need for Flash here. *User
agents are capable to load the audio resource directly with the object
element. *You will have to use another branch for MSHTML, though, that
uses a CLSID to trigger the Windows Media Player ActiveX control.
The second branch adds a bgsound element (or two) to the head and
changes the src property to play sounds.

There really is no need for that, unless you want to support IE 4.
It works far better in IE than the object approach. It is faster and
does not require ActiveX.
Feb 26 '08 #10

P: n/a
SAM
Thomas 'PointedEars' Lahn a écrit :
>
I don't see a need for removing the element, especially not because of
the uncertainty you mentioned.
OK
Audio compression aside, I also don't see a need for Flash here. User
agents are capable to load the audio resource directly with the object
element.
To load, probably, but to play it ? ... less sure.
You will have to use another branch for MSHTML, though, that
uses a CLSID to trigger the Windows Media Player ActiveX control.
What I would like to know is how you reactivate (replay) the sound
embeded in the object ? (without reloading the sound's file)
with any browser.

(and how an object can play a sound : certain of my browsers need the
tag embed)
>The second branch adds a bgsound element (or two) to the head and
changes the src property to play sounds.

There really is no need for that, unless you want to support IE 4.
And my NC4 ? do you think to my NC4 ? (with its AudioLive)

--
sm
Feb 26 '08 #11

P: n/a
On Feb 26, 6:24*pm, Joost Diepenmaat <jo...@zeekat.nlwrote:
Thomas 'PointedEars' Lahn <PointedE...@web.dewrites:
Audio compression aside, I also don't see a need for Flash here. *User
agents are capable to load the audio resource directly with the object
element.

This is an unusually sweeping statement coming from you. My main browser
(firefox 2.something on debian) certainly doesn't play mp3s when they're
provided via an object tag.
Either you do not have an appropriate plug-in installed (something
that any such script would need to detect), plug-ins are disabled or
the object markup is wrong.
Feb 26 '08 #12

P: n/a
On Feb 26, 6:41*pm, SAM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
Thomas 'PointedEars' Lahn a écrit :
I don't see a need for removing the element, especially not because of
the uncertainty you mentioned.

OK
No, Thomas is incorrect here. See my follow-up.
>
Audio compression aside, I also don't see a need for Flash here. *User
agents are capable to load the audio resource directly with the object
element.

To load, probably, but to play it ? ... less sure.
It works. At least in the browsers and plug-ins I have tested.
>
You will have to use another branch for MSHTML, though, that
uses a CLSID to trigger the Windows Media Player ActiveX control.

What I would like to know is how you reactivate (replay) the sound
embeded in the object ? (without reloading the sound's file)
with any browser.
I explained that.
>
(and how an object can play a sound : certain of my browsers need the
tag embed)
Perhaps NN4. That's about it. If you are going to *nest* objects
with param elements, then you need the non-standard embed element to
support older versions of Safari. Most Flash scripts wrap an object
around an embed, whether they need to or not. Regardless, the process
I described does not nest objects.
>
The second branch adds a bgsound element (or two) to the head and
changes the src property to play sounds.
There really is no need for that, unless you want to support IE 4.

And my NC4 ? do you think to my NC4 ? (with its AudioLive)
NN4? Perhaps you can tell me (see my other post.) I haven't tested
it in almost a decade (and when I did, it was surely with an embed
element.)
Feb 26 '08 #13

P: n/a
David Mark <dm***********@gmail.comwrites:
Either you do not have an appropriate plug-in installed (something
that any such script would need to detect), plug-ins are disabled or
the object markup is wrong.
Currently I don't have a plugin installed. I used to have a plugin
installed (I think it was the VLC plugin), but it always set the volume
to 0% and wouldn't auto-start so it was pretty useless.

In any case, if you're relying on plugins anyway, my /guess/ would be
that flash has the largest install base of any plugin.

What I'm getting at is that just using <objecttags is no guarantee
whatsoever and that, currently, using flash is probably a very sane
fallback/default if you want reasonably reliable scriptable sound.

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
Feb 27 '08 #14

P: n/a
David Mark wrote:
On Feb 26, 6:24 pm, Joost Diepenmaat <jo...@zeekat.nlwrote:
>Thomas 'PointedEars' Lahn <PointedE...@web.dewrites:
>>Audio compression aside, I also don't see a need for Flash here. User
agents are capable to load the audio resource directly with the object
element.
This is an unusually sweeping statement coming from you. My main browser
(firefox 2.something on debian) certainly doesn't play mp3s when they're
provided via an object tag.

Either you do not have an appropriate plug-in installed (something
that any such script would need to detect), plug-ins are disabled or
the object markup is wrong.
I don't think that with this approach the script would need to detect
whether there was an appropriate plugin installed (is that even possible
in !MSHTML?). If there is not, simply nothing happens.
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Feb 27 '08 #15

P: n/a
On Feb 26, 7:05*pm, Joost Diepenmaat <jo...@zeekat.nlwrote:
David Mark <dmark.cins...@gmail.comwrites:
Either you do not have an appropriate plug-in installed (something
that any such script would need to detect), plug-ins are disabled or
the object markup is wrong.

Currently I don't have a plugin installed. I used to have a plugin
installed (I think it was the VLC plugin), but it always set the volume
to 0% and wouldn't auto-start so it was pretty useless.
Sounds like it.
>
In any case, if you're relying on plugins anyway, my /guess/ would be
that flash has the largest install base of any plugin.
Perhaps, but not all versions are scriptable and is a lot of overhead
to play a sound effect.
>
What I'm getting at is that just using <objecttags is no guarantee
whatsoever and that, currently, using flash is probably a very sane
One needs no guarantees for an enhancement like sound effects.
fallback/default if you want reasonably reliable scriptable sound.
No, I think my method is far more reliable as it requires no plug-ins
at all for IE. As for the non-IE browsers, if there is no audio plug-
in, then the script detects that and doesn't attempt to play audio.
Applications can then disable any UI related to audio and all is
well. Doing that with Flash means additional overhead as you have to
detect the installed version number and compare it to versions that
are known to be scriptable (Flash sniffing.)
Feb 27 '08 #16

P: n/a
On Feb 26, 7:18*pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
David Mark wrote:
On Feb 26, 6:24 pm, Joost Diepenmaat <jo...@zeekat.nlwrote:
Thomas 'PointedEars' Lahn <PointedE...@web.dewrites:
Audio compression aside, I also don't see a need for Flash here. *User
agents are capable to load the audio resource directly with the object
element.
This is an unusually sweeping statement coming from you. My main browser
(firefox 2.something on debian) certainly doesn't play mp3s when they're
provided via an object tag.
Either you do not have an appropriate plug-in installed (something
that any such script would need to detect), plug-ins are disabled or
the object markup is wrong.

I don't think that with this approach the script would need to detect
whether there was an appropriate plugin installed (is that even possible
Certainly it would, else the browser may prompt the user to install a
plug-in (which is the last thing you want to subject your users to.)
Also, the application may have audio-related UI and will therefore
need to know whether audio is possible or not.
in !MSHTML?). *If there is not, simply nothing happens.
No, you can't detect it in IE and don't need to with my approach (it
always works in IE.)
Feb 27 '08 #17

P: n/a
Thomas 'PointedEars' Lahn <Po*********@web.dewrites:
It then is likely that you have done something wrong. I'm not on Debian
GNU/Linux now, but it works in Firefox 2.0.0.11 on Windows and I remember
it working on Debian (must have been Firefox 1.5.x) as well.
Oh, it may work, but it does rely on plugins being installed that
specifically handle it (and handle it usefully, see my other post in
this thread).
It also works in IE 7, Opera 9.25, NN 7.2, and even NN 4.8 on Windows.

I had created a test case then, slightly adapted now:

http://PointedEars.de/scripts/test/d...media/liveconn

If that doesn't work for you (script-support enabled), you should check your
about:plugins. It could be that a) you have no plugin that can handle the
media type or b) an obsolete or misconfigured player plugin prevents the
sound from playing.
I currently have no plugin enabled to handle <objectsounds (or at
least, neither wav or mp3) directly, again - see the other post. I do
have flash installed. Anyway I get a "install missing plugins" message,
which doesn't find "any suitable plugins".

This is with debian's Iceweasel (firefox) 2.0.0.11-1 on debian/intel 32
bits, which is not /that/ unusual.

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
Feb 27 '08 #18

P: n/a
David Mark <dm***********@gmail.comwrites:
No, I think my method is far more reliable as it requires no plug-ins
at all for IE. As for the non-IE browsers, if there is no audio plug-
in, then the script detects that and doesn't attempt to play audio.
Sure, but the point is you probably won't be able to detect if the
plugin actually supports audio the way you want to. Only that it can
potentially play audio.

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
Feb 27 '08 #19

P: n/a
Joost Diepenmaat wrote:
Thomas 'PointedEars' Lahn <Po*********@web.dewrites:
>It then is likely that you have done something wrong. I'm not on Debian
GNU/Linux now, but it works in Firefox 2.0.0.11 on Windows and I remember
it working on Debian (must have been Firefox 1.5.x) as well.

Oh, it may work, but it does rely on plugins being installed that
specifically handle it (and handle it usefully, see my other post in
this thread).
So what? If *you* install plugins that don't adhere to standards that is
*your* fault. Especially on GNU/Linux where there are several
possibilities. Firefox handles the object element as specified, at least
since version 1.5. It worked for me, IIRC with the mplayer plugin.
This is with debian's Iceweasel (firefox) 2.0.0.11-1 on debian/intel 32
bits, which is not /that/ unusual.
Non sequitur. The plugins are not provided by the browser package.
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Feb 27 '08 #20

P: n/a
Thomas 'PointedEars' Lahn <Po*********@web.dewrites:
So what? If *you* install plugins that don't adhere to standards that is
*your* fault.
What standards? Plugins can do whatever they like.
Non sequitur. The plugins are not provided by the browser package.
I'll do some research to see what I can dig up. From memory what I
installed was whatever the recommended plugin packages were.

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
Feb 27 '08 #21

P: n/a
On Feb 26, 7:41*pm, SAM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
David Mark a écrit :
>And it appears you have to convert every sound effect to MP3.
And then ?
The sound has to be coded anyway (even it is a midi), no ?
If you have a library of WAV, SND, MIDI, etc. files, then having to
convert them all to MP3 is a considerable drawback.

personally I have more midi than mp3
but I have no wav nor snd ...

So to judge mp3 or anything the other one?
I say it is a monstrously bad script and should be avoided at all
costs.

Perhaps could you help him ? ;-)
I'm sure I could. But why would I bother?
>
There are some others Flash mp3 players on the Net but most of them are
not so efficient (even if they probably be used too).
(I like this one :http://www.alsacreations.fr/dewplayer)
Why use Flash at all?

Perhaps only because that works ?
We've been over that. It works sometimes, just like other plug-ins.
(no loading except on user's action for instance, not to wait the end of
loading to begin to hear the sound/song/music, button for volume,
I do have a method to control the volume in IE, but it is really not
necessary. A mute button is a must though.
play-list, ... )
?
Perhaps because it is easy to insert in the page ?
No, it is not. It is ridiculously complex to insert a Flash movie.
That is why virtually every Flash script on the Internet resorts to
browser sniffing, and/or non-standard embed elements. Even Adobe gets
it wrong (horribly so.)
Perhaps because it is very light ?
As compared to audio plug-ins?
>
But I'am seriously very curious to see *with an example* how you do to
play a sound on demand (a "clic" when clicking a link for instance)
I would never do such thing, but yes, it is certainly possible. *I
have included an audio module in my library that allows for this sort
of user abuse. *Would you like to help with the Beta testing? *I would
like to get a few more Mac testers on board. *Send me an email if you
have some spare time.

OK
without using Flash and without downloading the sound each time.
Because personally I can't do it.
Audio files are cached just like other resources.

... ? ? ? ...

That was not exactly the question.
Cache doesn't avoid the go and back to the server (to compare dates)
If you are worried about that, then send appropriate headers with your
audio files to prevent it (e.g. far future expiration dates.)
>
Ie : with AudioLive (who yet know this antic ?) coming with NC<5
you had to load an empty sound file to get a space to play sound
then to give a kind of shortcuts to the sounds you want to play
on demand. (avowing to download all the sounds/musics if user didn't
want to listen all of them)
As I mentioned, ymmv with NN4. Luckily, nobody uses it.

[snip]
Feb 27 '08 #22

P: n/a
On Feb 26, 9:38*pm, SAM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
David Mark a écrit :
On Feb 26, 7:41 pm, SAM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
David Mark a écrit :
>>There are some others Flash mp3 players on the Net.
(I like this one :http://www.alsacreations.fr/dewplayer)
Why use Flash at all?
Perhaps only because that works ?
We've been over that. *It works sometimes, just like other plug-ins.

I think a bit more
Perhaps.
>
(no loading except on user's action for instance, not to wait the end of
loading to begin to hear the sound/song/music, button for volume,
I do have a method to control the volume in IE, but it is really not
necessary. *A mute button is a must though.

I don't agree with that : I've no real button to fix the volume and I
appreciate to have something very close of the play button on the page.
Play (and stop) buttons are no problem.
>
play-list, ... )
?

list of musics where to chose (attached to the player)

I'm still speaking of a flash player
(not Flash but a player built for Flash).
Yes, I understand what a playlist is, but I don't see the relevance to
ambient sounds in a Web page.
>
Perhaps because it is easy to insert in the page ?
No, it is not.

Yes it is, nothing to do except a bit of code to load the player and
some parameters to fix.
You have nothing to know about Flash.
YMMV. That "bit of code" is quite a lot if you want to do it right.
>
*It is ridiculously complex to insert a Flash movie.

not more, hop! a Flash movie player
?

[snip]
Feb 27 '08 #23

P: n/a
Thomas 'PointedEars' Lahn <Po*********@web.dewrites:
Joost Diepenmaat wrote:
>Thomas 'PointedEars' Lahn <Po*********@web.dewrites:
>>So what? If *you* install plugins that don't adhere to standards that is
*your* fault.

What standards? Plugins can do whatever they like.

Plugins that work with non-standard elements like `embed' and do not work
with standardized ones like `object' are simply junk. If *you* employ them
despite there are viable alternatives, that is *your* fault, not that of the
Web author who used the element or the (X)HTML user agent.
I can't help it if flash sucks. Most plugins suck. The issue is that
many browsers don't support native playing of audio and video, so you're
going to end up supporting some kind of plugin (and probably more than
one, if you want to be safe) anyway, and flash probably has a larger
install base than any other plugin capable of playing audio (and video).

Please point me to some kind of standard that says /anything at all/
about how and when sound is supposed to be played by an <objecttag. As
far as I know things like "autostart", streaming and volume control are
not defined anywhere.

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
Feb 27 '08 #24

P: n/a
Thomas 'PointedEars' Lahn <Po*********@web.dewrites:
I seriously doubt that, as AFAIK Windows Media Player 6 is preinstalled with
IE/Windows.
You may be right. Though I'm not sure about the situation on Macs, and
on most Linux distros you can pretty much count on having no multimedia
plugins whatsoever, especially ones supporting MP3 - you'll have to find
and install them yourself. Oh, and then there are (probably ignorable)
non-multimedia windows distributions:

http://www.microsoft.com/About/Legal...ision/faq.mspx

As for flash, it's pretty much a chicken-and-egg problem: flash is
popular enough on the popular platforms that many sites will use it, and
because of that, many people will have it installed, even if it's just
to be able to watch youtube. Having a pretty good, more or less "click
here to install and watch this video" installer works in their advantage
too.
>Please point me to some kind of standard that says /anything at all/
about how and when sound is supposed to be played by an <objecttag. As
far as I know things like "autostart", streaming and volume control are
not defined anywhere.

That is a valid point, though. If *that* is your problem, you are free to
remove the "hide controls" parameters and see if that works for your (it
should).
At this point, I've pretty much given up on any audio solution that
doesn't use flash (as a fallback, at least). I just couldn't get it to
work on my debian box using any of the standard (i.e. apt-get
installable from the default configuration) plugins. For "click here to
listen" scenarios, there are good non-flash solutions, but see below.
However, firstly any media player plugin should support the defined
parameters, and secondly if the "autostart" parameter are not supported, I
doubt the user would mind that there is silence. The same goes for using
ActiveX controls (which the Flash plugin also is on Windows). So I really
don't see the problem.
It's only a problem if you want scriptable sound. I.e. you want to
trigger sounds based on specific events, without too much (less than 100
ms or so) delay. The problem is mostly academic, since in most
situations where you'd use that, you'd probably use flash anyway, but I
ran into it trying to hack together a simple shooter game in javascript.

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
Feb 28 '08 #25

P: n/a
SAM
Thomas 'PointedEars' Lahn a écrit :
>
Plugins that work with non-standard elements like `embed' and do not work
with standardized ones like `object' are simply junk. If *you* employ them
despite there are viable alternatives, that is *your* fault, not that of the
Web author who used the element or the (X)HTML user agent.
I would apreciate you teel me which plug-in (standardized with 'object')
I can find to listen to sounds (in any format) with my Safari 2 on my Mac.

The JS functions of my QuickTime Player seems to work only with 'embed'.

--
sm
Feb 28 '08 #26

P: n/a
Thomas 'PointedEars' Lahn a écrit :
Joost Diepenmaat wrote:
>Thomas 'PointedEars' Lahn <Po*********@web.dewrites:
>>So what? If *you* install plugins that don't adhere to standards that is
*your* fault.
What standards? Plugins can do whatever they like.

Plugins that work with non-standard elements like `embed' and do not work
with standardized ones like `object' are simply junk. If *you* employ them
despite there are viable alternatives, that is *your* fault, not that of the
Web author who used the element or the (X)HTML user agent.
I don't get it.

You keep saying everything must be tested, everything must be supported
- even ultra odd rare stuff - and is the responsability of the web
author to provide something working in every exceptionnal situation.

However you just say it is not the author's responsability anymore when
it concerns plugins ?

At the moment I am using a plugin I, as a web author which I am not, am
allowed to do anything I want ?

If it is not working as expected with every available plugins it is your
fault, as a web visitor, and not mine anymore ?

I really don't get it. Why would the responsability be switched ?

--
laurent
Mar 3 '08 #27

This discussion thread is closed

Replies have been disabled for this discussion.