Background video in grid cms gallery

Hello everyone,
on my website I have a cms grid gallery which will show my work. I would love to have a background video playing inside each grid item as a preview and the project title if I hover over it with my mouse. When no one is hovering over it it should show a thumbnail picture and no text. Right now it’s only working with the project title.

I found this post about custom code and how to apply video to the grid, but I couldn’t figure out how to put the video behind the title.

What is the best way to realize my idea and how to do it the best way?


I’m not sure if this is the perfect solution for you but maybe this video helps?

Thank you for the link, it sent me in the right direction. For anyone looking, here is a good example: