This sounds like a bug in the Kindle Fire browser. If the first source file can be played, the second one should be ignored.
It might be worth changing the order of the source elements (i.e. put MP3 first). I doubt it will make a difference but just in case - could be some strange browser quirk.
Another possibility is a bug with the browser's autoplay implementation. Have you tried removing the autoplay
attribute? If that's the problem then you could try using JavaScript's play()
method on page load instead.
A more reliable solution is to use JavaScript to detect for codec support. Something like this should work:
HTML:
<audio id="myAudio">
Your browser does not support the audio element.
</audio>
JavaScript:
function getAudioType(element) {
if (element.canPlayType) {
// CanPlayType returns maybe, probably, or an empty string.
if (element.canPlayType('audio/ogg; codecs="vorbis"') !== '') {
return('ogg');
} else if (element.canPlayType('audio/mpeg;') !== '') {
return('mp3');
}
}
return false;
}
var audio = document.getElementById('myAudio');
var audiotype = getAudioType(audio);
if (!audiotype) {
// Some fallback or not-supported message here
} else {
audio.src = '../../audio/andromeda_oars.' + audiotype;
audio.play();
}
UPDATE:
Example of this in action