This is sort of a continuation of a previous question I had here: https://getsatisfaction.com/apperyio/...
I have multiple buttons using this code which I modified from the question linked to above:
precodeaudioText = '<audio id="yourAudio" src="audiosource.mp3"></audio>';
var audio = jQuery(audioText);
jQuery("body").append(audio);
var au = jQuery("#yourAudio")[0];
if (au.paused === false) {
au.pause();
// alert('music paused');
} else {
au.play();
// alert('music playing');
}/code/pre
When I first tested this out, it seemed I could have multiple buttons that would change the source of the audio so that when one wants to listen to audio source #2 they don't have to first stop audio source #1 before listening to audio source #2. This is what I want the app to do.
Now, it seems to only play the first audio source that was selected no matter what button (and audio source) I press.
Is this a bug or is this the intended behavior?
If this is how the HTML5 audio player is supposed to behave, is there a way I can change the source in the HTML5 player without creating a new HTML5 audio element?
Thanks,
Eric