I’m looking for some code to allow an auto play video in a wix gallery to stop playing on mouse click or mouse over. I know there are mouse over and click code you can add to a gallery, but I could not figure it out.
Hello, @alexkoyfman
Handling autoplay videos in a Wix gallery and controlling their behavior on mouse interactions is a common requirement. Let’s tackle this step by step:
Customizing Video Settings in Wix Pro Gallery:
Wix Pro Gallery allows you to add videos alongside images. You can customize video settings to control how they behave. Here’s how:
Click your Pro Gallery in the Wix editor.
Go to Settings.
Click the Advanced tab.
Customize the following options:
Play Videos: Choose from “On hover,” “Autoplay,” or “On click.”
Play with sound: Enable or disable sound for videos in the gallery view.
Play speed: Adjust the playback speed.
Loop videos: Enable or disable video looping.
Show play button: Toggle the play button display.
Autoplay Policies for Browsers Supported by Wix:
Wix currently supports four browsers: Google Chrome, Firefox, Safari for Mac, and Microsoft Edge.
Autoplay behavior varies based on user interactions and browser settings.
For example, muted autoplay is always allowed, but autoplay with sound depends on user interactions (e.g., clicks, taps) or previous video engagement.
Note that some older browser versions no longer support autoplay.
Wix Video Autoplay:
If you’re using Wix Video, you can enable or disable autoplay:
Click the Wix Video player in your editor.
Go to Settings.
Click the Player tab.
Toggle Autoplay on load:
Enabled: Videos play automatically when the page loads.
Disabled: Visitors need to click to play the videos.
Slideshow Autoplay Control:
If you’re dealing with a slideshow, you can also control autoplay behavior:
Click the Stop autoplay on hover toggle:
Enabled: Slides pause when visitors hover over the slideshow.
Remember, Wix provides a user-friendly interface for these settings, but if you need to dive into custom code, you can use JavaScript event listeners to handle mouse interactions.
I hope this info is helpful to you.
Best Regard,
Gregory Chavez