I linked an audio file to a line of text. When I click on it, the default audio player on my computer opens and plays the file. I want to play the file directly from the webpage or browser. How can I do this? The file is an mp3.
I linked an audio file to a line of text. When I click on it, the default audio player on my computer opens and plays the file. I want to play the file directly from the webpage or browser. How can I do this? The file is an mp3.
UPDATE:
I discovered that the Windows default player only opens when I click the link from the Xara preview window. When I open the page in a browser, the audio plays in the browser. However, it changes the page to dark gray with an audio player in the middle. When the audio is done I have to go back to the original page.
I also discovered that you can drag and drop the mp3 file directly onto the page, but when I do that it creates a small audio player and I could not find a way to link it to a line of text. It also repeats the audio over and over until I pause. I could not figure out how to make it play only once.
Is there a way to click on a line of text to play audio without it changing the page or opening a new tab or window? I'm pretty sure I have seen this before, but unfortunately I can't recall where or I would post an example.
Any help will be appreciated.
Did not do that before but I think you will need to include some player like audio.js or jplayer.
There also is an <audio> tag supported by modern browsers but I don't know if it can be customized to your needs. See http://www.w3schools.com/html/html5_audio.asp
Thanks "mikeymopar", the 'playloop' code worked.
I have two other questions,
1. Is there a way to specify the volume level when it starts playing?
2. The last second of audio is getting cut off, any way to prevent this?
Thanks again.
had a few minutes here between jobs and figured out for default volume in the same place you added playLoop also add "defaultVol":#.##,
such that it's in terms of a percentage - 0.00=muted, 0.5=50%, 1.00=max volume, etc...
you can find these variables by looking at the top of the html that you're modding for script that it calls. in this case when you look at the top you can find it calls in the index_htm_files folder the magix_player.js (i just exported the most simple doc only having the mp3 file as a website in order to see the build files). then using an editor (notepad++, sublime, etc) i searched magix_player.js for "default" and found defaultVol. same way to find playLoop verbiage
still haven't played with linking it yet. ionno off-hand why it would cut off the last second either.
Thanks, adding "defaultVol" did the trick. Thanks for explaining where I can find other variables as well. Now, to figure out why the audio is getting cut off. I thought perhaps it had something to do with the variable "duration:*", but changing the value does nothing. I think I'll post a new thread for that. Thanks again for all your help "mikeymopar".
Bookmarks