Okay
  Public Ticket #1876188
Music Player
Closed

Comments

  • Jamare Harris started the conversation

    How do I turn off auto play on my playlist?

  •  1,114
    Max replied

    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

  •  1,114
    Max replied

    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

  • Jamare Harris replied

    thx again lol

    your a great help.

  • Jamare Harris replied

    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?

  •  1,114
    Max replied

    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

  •  1
    Alex Lykesas replied

    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. 

  •  669
    Alexandre replied

    We will work on this. This is on on roadmap

    Thanks,


    Alexandre from the Sonaar.io Crew

  • Alexander Swann replied

    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!

  •  669
    Alexandre replied

    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

  • Alexander Swann replied

    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

  •  669
    Alexandre replied

    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

  • Alexander Swann replied

    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

  •  669
    Alexandre replied

    Great! 
    This will be part of the next update

    Thanks,


    Alexandre from the Sonaar.io Crew