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 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.
The topic ‘WP Audio functionality’ is closed to new replies.