Changing Video URL With Code

How would I change the URL of a video player in wix with code? Like, if I press a button the url on the video player will change? I’ve got the button part ready, but when I was looking through the API for the video player it shows I can change the url with .videoURL, however when I try to use .videoURL, it says that .videoURL doesn’t exist. Please help ASAP

Did you ever get an answer to this? I am having the same issue.

Check out the Video API reference for it.

Video
An element that displays a video from Vimeo or Youtube .
https://www.wix.com/corvid/reference/$w.Video.html

Video URL
https://www.wix.com/corvid/reference/$w.Video.html#videoUrl

Otherwise if your video is a file that you have uploaded to your media manager for example, then you use VideoPlayer.

VideoPlayer
An element for presenting videos.
A video player allows you to present video from:

To change the video when using VideoPlayer, then you need to be using VideoPlayer SRC
https://www.wix.com/corvid/reference/$w.VideoPlayer.html#src

Thanks so much for the assistance! I used “src” instead of “videoUrl” and it worked great! (Sometimes you just miss the forest for all of the trees in the way!!!)

Yes, we’ve all been there many times with Wix Code :wink: