Play video while "mouse over" or hover

Is it possible to play a video only while the mouse hovers over the video area?

Thanks a lot.

sometimes it is better to google if it is about only javascript.
here is what i found.

1 Like

Thanks @jameskoh

You could run a function ‘On Mouse Over’ using Hype’s built in Actions to run .play or .pause actions on the video. This article explains how to control video playback with JavaScript: Creating Play & Pause Buttons for Video

2 Likes

I use this in my video
http://www.localsquares.eu/doku.php?id=tools:videoclips

On mouse over this code:

var mediaElement = document.getElementById('participationvideo');
mediaElement.play();

On mouse out:

var mediaElement = document.getElementById('participationvideo');
mediaElement.pause();

And of course you need to create the java function, give it a name and call it under the mous actions…

Hope this helps.
Bas

2 Likes