Play Video Button

Hello,
How do I make a button play a video from Youtube. This is a pretty standard feature on most website builders but not on Wix or Editor X. And I remember looking for the same solution unsuccessfully about a year ago.
Any help will be much appreciated.
Thank you in advance.

You can set the button link to a youtube url for

@nelninio When you add the YouTube video player to the site, there is a play-button overlaid onto the video player. Are you saying you want to add a Button that triggers the video to play, instead of the play-button inside the video player?

Hi @nelninio ! Is this what you would like to do?: https://www.screencast.com/t/dLuDy7Fxs

The code I used in the video:

$w . onReady ( function () {

$w ( '#button1' ). onClick (() => { 
    $w ( '#videoPlayer1' ). play (); 
}) 

});

Thank you for the info Eve. But what I’m truing to do is have a button only and when clicked opens a video box. I don’t want to have the video displayed on the page. Does that makes sense?

This takes me out of the website. I don’t want to do that. I want the button to open a video box.

I don’t want to have the video displayed on the page, simply a button that opens a video box within the page.

I see.
In that case you need to link the button to a lightbox, and inside the lightbox, place a video box that is linked to the YouTube video.

Yes. It would look something like this.

@nelninio if you’d like another solution besides the one suggested below of using a light-box, you can also use click interaction. See video: https://www.screencast.com/t/YWYlS35sYk