I am using a WP audio plugin that does not have the simultaneous play feature. And, I would like to implement the feature.
Right now, when ‘audio player 1’ is playing a track, it will instantly stop playing when ‘audio player 2’ is playing a track, etc. I need all instances of the audio players to play simultaneously, but only when selected or chosen.
Is there any HTML5/Javascript snippet of code that I can use to override the settings to allow simultaneously play?
Unbelievable! I did it! I actually figured it out. And, it was so freaking simple, too. All I did was remove one line of code from the plugin’s massively coded block of a .js file: audiwp.pauseAllAudio(self);. Just one line!! Is this for real? LOL (but at the same time I want to cry). I spent days and hours researching and implementing different non-working workarounds without having to tackle the .js file. JavaScript is just not my forte. Glad I posted here and read your reply because it forced me tackle the .js file horror head on. Thanks. Elated I can finally move on with my project. Yes!
It is usually recommended that the library files not be adjusted, because if you update them later on, those changes that you made will no longer be there.
I recommend that you leave some documentation some where about the change that you made, in a place that it won’t get replaced so that if the library does get updated, you can more easily figure out what occurred and fix it.
…well, I was excited. Even though JS is not my thing, I don’t think any other code relies on it. I mean it’s just referencing the play button according to the code. I did compare another audio button’s coding, within the same file, with this one and the only difference I saw in the two codes were one had that line (the one I removed) while the other did not. So, based on that I figured all would be well.
The dev tools console is not throwing errors about it.
Didn’t know about linter, but researched it and found jslint.com. I guess the coder of the plugin doesn’t know about linter either or didn’t care. This .js file has some complaints: unexpected, expected, and unsafe. And, it seems to be the same complaint for each over and over again just in multiple spots of the file. However, no complaints in regards to me removing that line of code. The player with the complaints work smooth, imo. Will fixing the errors make it run better or something?
Oh ok. I actually made the note within the file using “//”, but I guess that would defeat the purpose if I ever get an update on this plugin. I’ll make a note in text editor and save it to my hard drive. Thanks!
Most of the time linting the code is for the benefit of the programmer, not the computer. JSLint is the harshest critic when it comes to linting code. There are other linters out there that aren’t as strict, but there’s little benefit to be gained when you aren’t aware of such potential problems.