Answer the question
In order to leave comments, you need to log in
Youtube video preview on hover?
What is the right way and how to implement it?
The client saw this feature on YouTube and now wants it to be the same on the site. There is a list of news with preview pictures and how can I implement them on hover so that they look like a GIF? If I understand correctly, this is a gif. But when you switch to this news, the YouTube player with the video is already inside
Answer the question
In order to leave comments, you need to log in
Are you familiar with the ommouseover, onmouseout events? What's so difficult...
If you need a gif, then generate a gif from a piece of video and insert it under the picture, hide the picture on hover, and the gif will become visible, instead of a gif, there can be a piece of video that is stored on the server. But making gifs or pieces for each video is somehow expensive.
Instead of a gif, you can insert an iframe with a video from youtube, hover over the picture and start playing the video (youtube iframe api). There is nothing complicated there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question