Reputation: 11
i want any code works like this you have static thumbnail as featured image, on hover it will automatically play HTML5 video which is pre-defined for each post (like youtube site)
Upvotes: 0
Views: 7928
Reputation: 464
Try this
if you want to go with WordPress plugin
1 - Easy Video Player - Free
2 - Media Hovers Wordpress Plugin - Paid
OR
If you want to go with coding -
You can add a poster by adding poster="Thumbnail-image.jpg" to the tag
.
<video poster="Thumbnail-image.jpg"
src="yourvideo.mp4"
id="id0" width="300" onMouseOver="id0.play()"
onMouseOut="id0.pause()"
onclick="window.location='yourvideo.mp4';id0.pause()"
loop title="yourvideo.mp4" >
</video>
here Thumbnail-image.jpg is your thumbnail image and yourvideo.mp4 is video to play on hover.
If the uploader of WordPress does not support .webm, .ogg or .mp4 files
(I haven’t checked that), you can always use an ftp (like Filezilla) program to upload the video’s.
Upvotes: 1