Okay
  Public Ticket #2794650
How can I link a button on our website, to start playing an individual song or playlist?
Closed

Comments

  • Jeffrey Chadwick started the conversation

    Good afternoon! 

    We just purchased your plugin and we are happy so far!

    One issue we are running into is linking current buttons on our site, to start playing our MP3s (we are using the full width sticky player). 

    For example, on our home page we have a "Start Listening" button and would love to have this start playing the first episode of the podcast: 

    http://s6k.33e.myftpupload.com

    Any help would be greatly appreciated! 

  •  327
    Alexandre replied

    Hi, 
    I dont know which tool are you using to built the button, but is you can add this code as the href(url link) you are in business.


    "javascript:IRON.sonaar.player.setPlayerAndPlay({ id:3498})"

    Thanks,


    Alexandre from the Sonaar.io Crew

  • Jeffrey Chadwick replied

    Thank you Alexandre! 

    One other quick question, how do we find the ID to link to another episode?  For instance, on each episode page, we would like to link to the corresponding episode. 

  •  327
    Alexandre replied

    Hi Jeffrey, 
    Please edit the podcast episode and you will see the ID number in the URL

    Thanks,


    Alexandre from the Sonaar.io Crew

  • Jeffrey Chadwick replied

    Alexandre, 

    We have each of our tracks in 1 album, but we would like to link to the individual tracks within that album to buttons on our website. I believe the ID below is the for the album itself, and not to an individual track. 

    Any more help would be greatly appreciated! Thank you

    Attached files:  Screen Shot 2021-06-10 at 4.09.21 PM.png

  •  327
    Alexandre replied

    Hi,

    You can use the "trackid" parameter to select a specific track. 
    The first track has the "0" as the trackid and the second track "1". 
    IRON.sonaar.player.setPlayer({ id:"1218", trackid:"0"})

    Thanks,


    Alexandre from the Sonaar.io Crew