The way you have it written it should result in some HTML like:
<a style='font-family:Arial,Helvetica,sans-serif;font-size:200%;' id="ui-btn-text" onclick="playSound('image/button.mp3');" href="#" data-ajax="false" data-transition="slide">
<embed src="image/button.mp4" hidden="true" autostart="true" loop="false" />
</a>
If it's going to be hidden already, why not just leave it someplace on the page and simply trigger the audio to play when the button is clicked. Set autostart="false"
and then use JS/JQuery to play the mp4 when the button is clicked.
HTML
<a style='font-family:Arial,Helvetica,sans-serif;font-size:200%;' id="ui-btn-text" onclick="playSound('ui-btn-sound');" href="#" data-ajax="false" data-transition="slide">
</a>
<embed src="image/button.mp4" hidden="true" autostart="false" loop="false" id="ui-btn-sound" />
JavaScript
function playSound(id) {
var audioFile = document.getElementById(id);
audioFile.Play();
return false;
}
I personally would suggest using HTML5 audio
tag and fall back to an embedded option if needed.
<audio controls>
<source src="image/button.mp4" type="audio/mp4">
<!-- Fail Over -->
<embed src="image/button.mp4" hidden="true" autostart="false" loop="false" id="ui-btn-sound" />
<a href="" onclick="playSound('ui-btn-sound')">Play</a>
</audio>
The audio
tag also has lots of ways to control it's look and function via JS/JQuery. You might want to look into things like audio.canPlayType('audio/mp4');
.
Here is an older example, someone challenged me to make a piano that did not have lag between each note and allowed other notes to be stopped when a new note was played: http://www.yrmailfrom.me/projects/html5/piano.php
Edit:
After answering this, I was inspired to create a quick JQM HTML5 player: http://www.yrmailfrom.me/projects/html5/audioplay.php
Hope that helps you.