Title: WP Audio functionality
Last modified: December 14, 2018

---

# WP Audio functionality

 *  [darksoundlab](https://wordpress.org/support/users/darksoundlab/)
 * (@darksoundlab)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/wp-audio-functionality/)
 * I am having trouble with embedded wp audio players. I have many single file players
   on a single page and am running into issues trying to play through each of them.
   First off, when I play one and then go to play another, the first play doesn’t
   stop or pause. I found this code which I was able to add to the site which fixes
   this issue:
 *     ```
       window.addEventListener("play", function(evt)
       {
       if(window.$_currentlyPlaying)
       {
           window.$_currentlyPlaying.pause();
       } 
       window.$_currentlyPlaying = evt.target;
       }, true);
       ```
   
 * But my next issue seems more difficult to find a solution for. After playing 
   through several files, eventually the players freeze and won’t play anymore. 
   I think this has something to do maybe with browser cache or memory but does 
   seem to be an issue with all browsers. In exploring options and solutions I found
   [MP3-jPlayer](https://wordpress.org/plugins/mp3-jplayer/) which, although it 
   has not been updated recently, does solve this issue. It seems to “unload” the
   audio or remove it from the player somehow when a new file is played.
 * Does anyone know how to get this functionality to work on the default WP [audio]
   player? I don’t want to have to go through extensive styling on the MP3-jPlayer
   and would much prefer adding some relatively simple code to get the player(s)
   to unload, unbuffer or uncache the audio file when another player is selected.
 * Thank you in advance if you can help.

Viewing 1 replies (of 1 total)

 *  [Robert Anderson](https://wordpress.org/support/users/noisysocks/)
 * (@noisysocks)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/wp-audio-functionality/#post-11001061)
 * It should be possible to write JavaScript [that unloads an `<audio>` element by removing the `src` attribute and calling `load()`](https://stackoverflow.com/a/28060352).
 * However some further development is required to make sure that such an approach
   doesn’t break the play button.
 * I recommend using a WordPress audio player plugin if you are not comfortable 
   with writing JavaScript.

Viewing 1 replies (of 1 total)

The topic ‘WP Audio functionality’ is closed to new replies.

## Tags

 * [cache](https://wordpress.org/support/topic-tag/cache/)
 * [pause](https://wordpress.org/support/topic-tag/pause/)
 * [unload](https://wordpress.org/support/topic-tag/unload/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Robert Anderson](https://wordpress.org/support/users/noisysocks/)
 * Last activity: [7 years, 5 months ago](https://wordpress.org/support/topic/wp-audio-functionality/#post-11001061)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
