How to play an audio track without using "controls" |
How to play an audio track without using "controls" |
giomach |
Jun 19 2021, 12:07 PM
Post
#1
|
Group: Members Posts: 2 Joined: 19-June 21 Member No.: 27,985 |
I have an audio file (mp3), and I want to allow the web user to choose to play a section (track) of it.
I could split the audio file into many separate files, but I have begun to look at the <track> sub-element of the <audio> element of HTML5. Many webpages tell us how to formulate this element, eg. to give the start time of each track in a .vtt file, and that is fine. But I don't want "controls", I want to display a list of tracks, and let the user decide which track to play, and click an icon to play it. It must be blindingly obvious how to do this, but I can't find the HTML statement to start up a numbered track. Thanks for any hints. |
fspade |
Jan 24 2022, 03:15 AM
Post
#2
|
Group: Members Posts: 8 Joined: 22-January 22 Member No.: 28,234 |
Pandy,
you are my hero! That is exactly what I dreamt of. I owe you at least a coffee. Contact me when you come near. Keep up the good work and stay healthy and happy! Frank |
pandy |
Jan 24 2022, 03:58 AM
Post
#3
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,734 Joined: 9-August 06 Member No.: 6 |
And you thought it wouldn't help.
I want to explain the link. That you also have the URL to the sound file in the href combined with the return false after that function call, makes it work either JS is available or not. If it is available the return false kills the link event. Without it the link would be followed and you would get what you originally had. But if JS is not available the link will be followed and the user will at least hear the sound, even if it will load a s a new page. |
Lo-Fi Version | Time is now: 28th May 2024 - 03:59 AM |