Need Help with Designing and Coding a Spotify-Like Music Player on Wix Using Velo

Hey Forum Fam,

I’m building a Spotify-style music player on Wix using Velo.
I’ve got the basics down – Wix audio player, vector buttons – but I’m struggling with button functionality,

Button Functionality: I’m struggling with implementing the functionality for the buttons. How can I make each button perform its intended action (e.g., play, pause, shuffle, etc.) when clicked?

Thank you in advance for your time and assistance! If you need more details or code snippets, please let me know.

image

BASICS:

Everything on your pages begins either with IMPORTS of APIs and with…
$w.onReady(()=>{...........here your code..............}

Once you have added this peace of code onto your page’S code-section, you can continue to add a button-trigger…like…

`$w.onReady(()=>{
     $w('#myButtonIdHere').onClick(()=>{
          //..... continue adding the functionality for your button here....
     });
}`

Let’S upgrage your code…

`$w.onReady(()=>{
     $w('#myButtonIdHere').onClick(()=>{
          myFunction();
     });
}`


function myFunction(){
     $w("#myVideoPlayer").play()
    .then(()=> { console.log("Done with play");});
}

You can addmore functionality into your function (what ever you want).

To know which abilities/possibilities you have, you take a look here…