Okay
  Public Ticket #2951883
MP3 Audio Player Individual Track Links
Closed

Comments

  • Jonny Stanway started the conversation

    Hello,

    First let me say I'm loving the theme and plugins, a pleasure to work with!

    I was wondering if it's possible to have a link to change the audio playlist to an individual track? I notice you can click the link in the Music Player to switch to an individual track. What I'm looking for is the ability to put something like this on a page...

    <a href="link-to-my.mp3" data-audiopath="link-to-my.mp3" data-tracktitle="my-track-title">Play the track</a>

    ...and then the track would come up in the audio player. Is this possible? Or is there any similar functionality available?

    Thanks in advance!

    Jonny

  •  1,101
    Max replied

    Hi,

    Im not really sure to understand correctly the initial question:

    "I was wondering if it's possible to have a link to change the audio playlist to an individual track? "

    What are you trying to achieve as the end result?


    Thanks,


    Max from the Sonaar.io Crew

  • Jonny Stanway replied

    Hi Max,

    Thanks for the quick response.

    What I'm trying to achieve is to be able to put a link to play an audio track into the page content.

    So the user clicks the link and the track plays on the built in audio player that the theme uses.

    Hope that makes sense, let me know if you need more clarification.

    Thanks,

    Jonny

  •  644
    Alexandre replied

    Hi Jonny,

    No, we cant set the mp3 file through a html link.  The audio file has to be set through a shortcode, elementor element, gutenberg block or through a playlist built in the post settings.  

     My suggestion is to built a playlist with all those track and then you will be able to call them with a link like 

     <a href="javascript:IRON.sonaar.player.setPlayerAndPlay({ id:'10', trackid:'1' });">Play the track</a>

    Be aware I m currently working on a new shortcode to make those kind of link more easy to set

    Thanks,


    Alexandre from the Sonaar.io Crew

  • Jonny Stanway replied

    Hi Alexandre,

    That's perfect. Thank you very much for your help and the quick response it's much appreciated.

    All the best,

    Jonny

  •  644
    Alexandre replied

    You are welcome

    Thanks,


    Alexandre from the Sonaar.io Crew