Comments Mehdi started the conversationSeptember 7, 2023 at 4:55pmHi,I've found a Javascript API to load a playlist in the sticky player on this link:https://sonaar.io/docs/using-javascript-api/I need another JS API to show playlist tracks and when a user clicks on a track that track plays in the sticky player.I don't want to use PHP shortcodes on this link :https://sonaar.io/docs/add-audio-player-with-shortcode/because they need to reload the header and I don't want to reload my website header to view the shortcode.Is there any Javascript API to show the playlist tracks?Thanks 669Alexandre repliedSeptember 7, 2023 at 7:13pmHi Mehdi, I'm not sure if this is what you want but here is a js code to load a playlist in the sticky player and open the sticky tracklist:(You have to replace the id value by a playlist post id)IRON.sonaar.player.setPlayer({ id:"4494"});if(!IRON.sonaar.player.setshowList()){ IRON.sonaar.player.setshowList();}Thanks, Alexandre from the Sonaar.io Crew1 LikeMehdi repliedSeptember 8, 2023 at 5:36amHi Alexandre,Thanks for your answer,I want to show the tracklist on the page like the image that I've attached.if there is not any js API to achieve this, 1. Is there any REST API endpoint that loads the tracklist? (I've found sr_playlist endpoint but it doesn't load the tracklist)2. Is there any function to get the tracklist from it?Attached files: playlist.JPG 669Alexandre repliedSeptember 8, 2023 at 1:31pmHi Mehdi, No sorry. We dont have any js code to provide to achieve what you want.Thanks, Alexandre from the Sonaar.io Crew Sign in to reply ...
Hi,
I've found a Javascript API to load a playlist in the sticky player on this link:
https://sonaar.io/docs/using-javascript-api/
I need another JS API to show playlist tracks and when a user clicks on a track that track plays in the sticky player.
I don't want to use PHP shortcodes on this link :
https://sonaar.io/docs/add-audio-player-with-shortcode/
because they need to reload the header and I don't want to reload my website header to view the shortcode.
Is there any Javascript API to show the playlist tracks?
Thanks
Hi Mehdi,
I'm not sure if this is what you want but here is a js code to load a playlist in the sticky player and open the sticky tracklist:
(You have to replace the id value by a playlist post id)
IRON.sonaar.player.setPlayer({ id:"4494"});
if(!IRON.sonaar.player.setshowList()){
IRON.sonaar.player.setshowList();
}
Thanks,
Alexandre from the Sonaar.io Crew
Hi Alexandre,
Thanks for your answer,
I want to show the tracklist on the page like the image that I've attached.
if there is not any js API to achieve this,
1. Is there any REST API endpoint that loads the tracklist? (I've found sr_playlist endpoint but it doesn't load the tracklist)
2. Is there any function to get the tracklist from it?
Attached files: playlist.JPG
Hi Mehdi,
No sorry. We dont have any js code to provide to achieve what you want.
Thanks,
Alexandre from the Sonaar.io Crew