I while back I added a little countdown timer for an action on our website which also plays a ticking and "ding" sound. I didn't have too much trouble getting it to work across all browsers...or at least I thought.

I received a complaint from a visitor that they were getting a message in Safari (on windows) that there was an unknown MIME type on the page. Testing it on my install of Safari, it works fine. I quickly found what different MIME types are needed depending on the browser and players installed on the system in question. I can easily code a routine to use the correct mime type in JS or PHP. However, because playback depends on what the visitor is using and has installed, they can still get an error. I believe, if the browser can't load or play the sound (or any MIME type) it should fail gracefully (nothing at all or a message on the page , without some bulky browser error message window the user needs to close in order to continue.

Which brings me to my question: is there a way to prevent a browser from throwing up some error message if it does not know how to load the MIME type in question?

Thanks in advance
Loren

Hey,
Unfortunately when just loading a plain sound file there is no way of managing the errors (Its a browser error)
The only thing I would sugest is using some sort of Flash framework and refferencing it through JS. Or if you are feeling adventurous you could play about with <HTML5>

Preloading is setting up the player to be ready to play so the situation would be the same as if I were to just let it play. I can remember seeing on some sites a message on the page where a player plug-in would go, not a pop-up error message. Only I can't remember where or reproduce it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.