Since you can’t set videos in progalleries through wixcode (though the code api documentation says you can), I was going to use a workaround by adding a seperate video element and hiding it when a certain item is clicked.
However, these events don’t fire at all and neither console.log messages, nor anything else in it works.
Here is the page in question: https://www.dennisvdharst.com/Portfolio/Ludum-Dare-41%3A-FishX-Brawl (still heavily under construction as you can see.)
Currently the code I have for the onCurrentItemChanged event is:
export function projectGallery_currentItemChanged(event, $w) {
//Add your code for this event here:
console.log(“Hey”);
let imageSRC = event.currentIndex;
if ( (imageSRC === 0 || 1) && (videos[imageSRC] !== undefined)) {
$w(“#video1”).show();
$w(“#video1”).videoUrl = videos[imageSRC];
}
else {
$w(“#video1”).hide();
}
console.log(“Click” + imageSRC);
}
And here’s the settings of the pro gallery:
I don’t suppose there’s another way to make an event like this work?
With kind regards,
Dennis van der Harst