Problems creating a dynamic audio player
-
Hi – love this plugin!!
When I use it in the traditional way with a fixed url for the source, it works beautifully. However, I’m having problems when I send a variable as the source.
Here for instance, with pointy brackets, the default player appears, and plays theselected file correctly:
<!DOCTYPE html> <html> <head> <script type="text/javascript"></script> </head> <body> <div class="player"> <audio id='audio_core' src = '' controls ></audio> <script> var babyname = sessionStorage.getItem("babyname"), mypath="https://myluckyname.com/wp-content/uploads/2019/03/"+ babyname +".mp3", src=mypath, audio_core=$('#audio_core').attr('src', src)[0] audio_core.load() // <- play the song!!! </script> </div> </body> </html>
but when I replace the pointy brackets on the audio shortcode with square brackets:
[audio id='audio_core' src = '' controls][/audio]
your player appears, but there’s no source.
Thank you!!!!!
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Problems creating a dynamic audio player’ is closed to new replies.