Control a video with OnClick event

Hello all!
I’ve been trying to control the vimeo video box I’ve added to my page. So far I’ve been using Hide/Show for hiding and showing different video boxes - but what I’d really like to do is use an OnClick event to change the URL of the frame instead.

I tried something like:

$w(‘#video1’).src = “”;
export function image3_click(event) { $w(“#video1”).src = “London Tornado - The aftermath on Vimeo”;}

But this didn’t work.
Any ideas where I’m going wrong? I searched but couldn’t find a solution online.

Thanks everyone!

P.S. I get the message ‘videoUrl’ does not exist on ‘#video1

Guys, I figured it out. I needed to set the SRC, not the URL. DOH! For any other Homers like me - see below:

export function box3_click(event) {$w(“#videoPlayer1”).src = “Wix Presents: Manage Your Business with Wix - YouTube”;}

That will work.

Eve, “videoUrl” is actually the property to change:

$w(‘#video1’).videoUrl = " https://vimeo.com/123456 "

Hey Anthony, thanks for responding. I just noticed that SRC was the first one I posted, I had actually tried URL and SRC, but now it seems only SRC works. Very strange! Must have had some invisible junk code in there :slight_smile: Thank you for responding nonetheless.