Bill
I have placed a note in the XAR design file: Jukebox-v3.xar
The note reads as follows:
PLACEHOLDER HTML code (body)
<audio id="audiplay" src="https://domain-name/assets/load.mp3" controls autoplay controlsList="nodownload" style="width: 500px;"></audio>
1. load.mp3 is a short 1second silent audio track - this is required for the native browser to validate it is a MP3 format file. The placeholder width should be the SAME as that in the Placeholder code. Height is not relevant, but I use 59px.
2. ‘assets’ is a directory into which the MP3s should be loaded, the name can be anything.
WEBSITE HTML Code (body)
<script>
var audio;
var source ='https://domain-name/assets/';
function aplayer(song){
var locate = document.getElementById('audiplay').setAttribute(' src', source + song);
audio=locate;
}
</script>
LINK TO EACH SONG
javascript: aplayer('song-title-filename.mp3');
IN-PLAY GREEN
javascript: audiplay.play();
PAUSE YELLOW
javascript: audiplay.pause();
STOP RED
javascript: aplayer('load.mp3');
You need a short silent MP3 load.mp3 Just download a copy if you don't have one.
Gary
Bookmarks