If your web server supports a server-side script, for example PHP, you can pass a URL parameter to the player webpage, then play different mp3 files according to the URL parameter.
This is useful when you use iframe to add players to a webpage and you want to use the same player to play different mp3 files. Continue reading →
Your text link in the post Play/pause Audio Player with API worked great with full list of songs on the page. However, when we tried it with the iframe on the page, it did not start the player. Any idea how to make the text link work with the iframe? The iframe approach is a much simpler structure for us.
Answer:
When adding the iframe, assign an id for it, for example:
The amazingAudioPlayerObjects is a global object created by the player.
For example, the following two text links will play/pause the audio player:
<a href=”javascript:amazingAudioPlayerObjects.objects[0].playAudio();”>Click to Play</a> <a href=”javascript:amazingAudioPlayerObjects.objects[0].pauseAudio();”>Click to Pause</a>
The following two text links will play the second and fifth song:
<a href=”javascript:amazingAudioPlayerObjects.objects[0].audioRun(1, true);”>Click to Play</a> <a href=”javascript:amazingAudioPlayerObjects.objects[0].audioRun(4, true);”>Click to Pause</a>
I purchased a license of your Amazing Audio Player and am wondering if i can fire off an ajax call at the end of the mp3 or on a timer during playing of the track.
Answer:
You can use the following code snippet to bind the event when an audio track ends, then in the function, you can fire off your ajax call.
The amazingaudioplayer-1 in the code is the id of the player div. If you have selected a different ID in the publish dialog, you need to change the number accordingly.