Quote Originally Posted by bwood View Post
Gary. I tried to edit my post but server timed out. I now understand where the song clips will rest. Assets/host server.
Just a little unsure where all the pieces of code are supposed to reside.
I need a place for the script. And the placeholder (obviously where the player is supposed to be) so I got that. And placement of the iframe code. Thanks
-Bill

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