Autoplaying is super not helpful when you go page to page and the same track just keeps playing if you interact with the browser too quickly. For those getting frustrated by this do the following (took me 1-2 hours of banging my head against the screen but hopefully this while help you). It will disable autoplay but keep your sticky player where you like (Hurray!)
1) Go to cPanel or equivalent editor and go to the following file `public_html/wp-content/plugins/sonaar-music-pro/public/js/sonaarPlayer.js`
2) Go to line 585 OR search for the following and comment it out (or just delete it):
3) Save and reload your page flushing the memory using Cmd + shift + r (or ctrl if using Windows)
Explanation as to why this works: someone thought it smart to add an event listener that when the sticky player is ready it plays. This essentially happen when the page loads as then the audio is loaded into the player, thus triggering this event. It appears there is autoplay functionality in the player that might actually get bypassing because of this. Anyway it would be great to know from the devs if this might create some unexpected behaviour. If so then please let us know. Many thanks!
1. Thanks for your help, We will remove the sames lines on our next plugin update. But some other modification is also required, because for now, with those lines removed, the sticky audio player doesnt work well when we start the song from a widget player.
If you want to fix it on your side, please edit the /sonaar-music-pro/public/js/iron-audioplayer/iron-audioplayer.js file
Search this line "audioPlayer.data('currentTrack', eq)" And copy this code above:
if( wavesurferEnable ){ IRON.sonaar.player.wavesurfer.on('ready', function () { IRON.sonaar.player.wavesurfer.play(); }); }
2. The Enable scrollbar option still available. Are you using Elementor Editor? Where the option is missing?
Ah yes you are right. I tested this earlier and realised by doing that it stops the sticky player playing when you play from the widget player as you said. However, this is much more preferable compared to the alternative of having the track play on every page. Many thanks for your quick reply. I have followed your steps. The fix seems to have worked when copying that below line 336 in that file rather than above. But in either case, a big thank you. That indeed works! :)
Ignore me re: scrollbar, you are totally right, didn't realise it was waaay down the styling section. Apologies. Will remove that comment. I think I expected a global setting rather than one for each player widget (Might be a future feature worth considering and sticking in your backlog maybe *shrug*). Inadvertently I have created one through belligerent hacky code XD
I updated my comment below. To reiterate, yes it does work. :) Just needs to be pasted in below the line with "audioPlayer.data('currentTrack', eq)" rather than above it. Many thanks for your help again
How do I turn off auto play on my playlist?
Hi,
I cant see your website because it has a coming soon page.
Could you please provide me access to your wp-admin and I will gladly check the issue you have.
Thanks,
Max from the Sonaar.io Crew
Wait, i've got the access from another ticket you submitted.
to turn off the autoplay, edit your homepage and select no playlist in the setting box here: https://d.pr/i/EgcBOD
Thanks,
Max from the Sonaar.io Crew
thx again lol
your a great help.
Hi
This removed the playlist altogether. Is there a way to keep the playlist but keep it from playing the music when you open the page?
The autoplay is controled by the auto-play policy of the browser.
https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
At this time, Its not possible to control the player to shows up without controling if either or not it should be auto-played.
Thanks,
Max from the Sonaar.io Crew
I would like to have the autoplay disabled and show the playlist when page loads.
you should add this option in some preference.
I am saying this because i randomly get the music player playing when browsing through pages.
only your demo website gets to be able to be autoplayed, since chrome is letting only popular sites to get autoplayed.
We will work on this. This is on on roadmap
Thanks,
Alexandre from the Sonaar.io Crew
Hello Sonaar peeps,
Autoplaying is super not helpful when you go page to page and the same track just keeps playing if you interact with the browser too quickly. For those getting frustrated by this do the following (took me 1-2 hours of banging my head against the screen but hopefully this while help you). It will disable autoplay but keep your sticky player where you like (Hurray!)
1) Go to cPanel or equivalent editor and go to the following file `public_html/wp-content/plugins/sonaar-music-pro/public/js/sonaarPlayer.js`
2) Go to line 585 OR search for the following and comment it out (or just delete it):
this.wavesurfer.on('ready', function() {
this.wavesurfer.play()
}.bind(this))
3) Save and reload your page flushing the memory using Cmd + shift + r (or ctrl if using Windows)
Explanation as to why this works: someone thought it smart to add an event listener that when the sticky player is ready it plays. This essentially happen when the page loads as then the audio is loaded into the player, thus triggering this event. It appears there is autoplay functionality in the player that might actually get bypassing because of this. Anyway it would be great to know from the devs if this might create some unexpected behaviour. If so then please let us know. Many thanks!
Hi Alexander,
1.
Thanks for your help,
We will remove the sames lines on our next plugin update.
But some other modification is also required, because for now, with those lines removed, the sticky audio player doesnt work well when we start the song from a widget player.
If you want to fix it on your side, please edit the /sonaar-music-pro/public/js/iron-audioplayer/iron-audioplayer.js file
Search this line "audioPlayer.data('currentTrack', eq)"
And copy this code above:
if( wavesurferEnable ){
IRON.sonaar.player.wavesurfer.on('ready', function () {
IRON.sonaar.player.wavesurfer.play();
});
}
2.
The Enable scrollbar option still available. Are you using Elementor Editor? Where the option is missing?
Thanks,
Alexandre from the Sonaar.io Crew
Thanks Alexandre,
Ah yes you are right. I tested this earlier and realised by doing that it stops the sticky player playing when you play from the widget player as you said. However, this is much more preferable compared to the alternative of having the track play on every page. Many thanks for your quick reply. I have followed your steps. The fix seems to have worked when copying that below line 336 in that file rather than above. But in either case, a big thank you. That indeed works! :)
Ignore me re: scrollbar, you are totally right, didn't realise it was waaay down the styling section. Apologies. Will remove that comment. I think I expected a global setting rather than one for each player widget (Might be a future feature worth considering and sticking in your backlog maybe *shrug*). Inadvertently I have created one through belligerent hacky code XD
You are welcome,
Please tell me how it goes with the code I provided. If everything work fine.
Thanks,
Alexandre from the Sonaar.io Crew
I updated my comment below. To reiterate, yes it does work. :) Just needs to be pasted in below the line with "audioPlayer.data('currentTrack', eq)" rather than above it. Many thanks for your help again
Great!
This will be part of the next update
Thanks,
Alexandre from the Sonaar.io Crew