How can I play midi and/or audio files?

T

Thomas 'PointedEars' Lahn

Stephen said:
Thomas said:
Stephen said:
[...]
SCmediaPlay.prototype.playSound=function()
{

this.removeObj();

this.objRef=document.createElement('embed');

There is no `embed' element in HTML, so this is not supposed to work in a
standards compliant UA. And any UA that supports DOM Level 2 Core should
also support the standards compliant `object' element, so you should
create that.

It's a matter of what can be made to work. You should know that the
existence of standards does not mean that they can be relied upon
unconditionally. One has to work with what is known to exist.

One should target standards first. Proprietary features are by definition
not interoperable or future-proof. We discussed this before.
I tried to use 'object' but IE wouldn't hide the plugin. Is there a
standard for that?

Incidentally, there is.

if(document.body && document.createElement)

That is an existence test, not a feature test. Read my posting again.
Is that according to a standard or just folklore?

It is a known fact.
As far as I could test, it does.

You see?
Initially I tried to avoid using setAttibute, but it didn't work on one
browser.

Which browser? Which property/attribute name?
I can test only within the scope of platforms and software available to
me.

Which is obviously insufficient.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,444
Messages
2,571,709
Members
48,796
Latest member
Greg L.
Top