How to specify the start and end time of an audio in WordPress audio player by using URL parameters or query strings

This tutorial will guide you how to specify the start and end time of an audio in the audio player created with Wonder Audio Player by using URL parameters or URL query strings.

There are two steps in this tutorial.

Step 1 - Install Wonder Audio Player and Create an audio player

First please install the WordPress premium plugin Wonder Audio Player. You can download the free trial version from the plugin home page, test it, make sure it works for you before upgrading to the commercial version.

After you install the plugin, you can view this post for how to create an audio player: Wonder Audio Player Quick Start Guide. You can also view the quick start video: How to create a WordPress audio player.

Step 2 - Specify the start and end time using URL parameters

To specify the start and end time in URL parameters or URL query strings:

  • Use audioid to specify the audio, the audioid starts from 0, for example, audioid=2 will jump to the third audio.
  • Use start and end to specify the start and end time in seconds.

When adding parameters to a URL, the first parameter needs to be concatenated with a question mark ?, the second and after need to use the and mark &.

The following URL will go to the third audio, jump to 30 seconds. If you play the audio, it will automatically stop at 60 seconds, that's, 1 minute.

https://www.wonderplugin.com/wordpress-audio-player/?audioid=2&start=30&end=60

The start and end time will only work once, that's, on page load, the player will go to the specified audio and jump to the specified time, if you play the audio, it will stop at the specified end time. But if you play another audio, or play the same audio again, the start and end time will be ignored.

Please note, Firefox, Chrome and Safari recently changed their audio autoplay policy. Audio autoplay on page load does not work anymore and there is no workaround.