• Hello! I am currently working on a simple mock-up website for a digital humanities project, and I had a question regarding loading audio dynamically using the Participants Database.

    It it possible to call data from a “File Upload” or “Link” field and have it automatically load into the default WordPress audio player? Ideally, each entry would feature an audio player at the top that plays an MP3 that was uploaded using the “File Upload” function.

    I’m also open to using other types of audio players too, if it is easier.

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Roland Barker

    (@xnau)

    There are probably several ways to do this. I’ve posted a sample plugin that you can use to show uploaded audio as an HTML5 audio element. That is undoubtedly the simplest way to do this.

    https://gist.github.com/xnau/90a648686bccd3af0565c317ba9f947e

    If you know a little PHP, you can easily customize this to also show an externally-hosted file in an audio element. You would just use a “text-line” element instead of a “file-upload” element. The user would just type in the full URL to the audio file, and it would be displayed as an audio element.

    Be sure to sanitize the input no matter what.

    Thread Starter miantorno

    (@miantorno)

    This works great. Thanks!

    http://michaeliantorno.com/whatsthescore/index.php/listings/?pdb=8

    Would it be possible for it to call the default WordPress audio player, instead of an HTML5 audio element?

    • This reply was modified 8 years, 6 months ago by miantorno.
    • This reply was modified 8 years, 6 months ago by miantorno.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Audio Player Dynamically Loads Field URL’ is closed to new replies.