Answers for "html play video on hover"

0

html play video on hover

In HTML Document:
<video width='500' height='150'
       onmouseenter='VideoController(true, this)'
       onmouseleave='VideoController(false, this)'
       src="Videos/test.webm" loop>
  Your browser does not support the video tag.
</video>

In CSS:
const VideoController = function(isHovering, videoElement)
{
	if (isHovering == true)
    {
        videoElement.play();
    }
    else if (isHovering == false)
    {
        videoElement.pause();
    }
}
Posted by: Guest on April-08-2020
0

html play video on hover

this isnt working via css. is thsi js?
Posted by: Guest on July-09-2021

Browse Popular Code Answers by Language