I made a custom play button via PNG that appears when the cursor is hovering over the video thumbnail. But now the video isn't clickable. If I set pointer events to none it won't make the hover event show up.
.videothumbnail img{
width: 100%;
object-fit: contain;
display: block;
}
.videothumbnail{
overflow: hidden;
position: relative;
}
.videothumbnail img{
transition: transform .3s ease;
}
.videothumbnail:hover img {
transform: scale(1.1);
}
.playbutton{
position: absolute;
width: 100%;
height: 100%;
top: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.521);
opacity: 0;
transition: .3s;
}
.playbutton:hover{
opacity: 1;
}
<div class="column">
<div class="videothumbnail">
<a href="https://www.youtube.com/watch?v=MVTQJQQkj4E"><img src="afp_images/photographs/musicvideos/UNTAINTED_THUMBNAIL.jpg" alt=""/></a>
<div class="playbutton"><img src="afp_images/photographs/musicvideos/playbuttonoverlay.png"></div>
</div>
</div>
Instead of sourcing the play button overlay in the HTML, I tried to source it as a background-image in the CSS but that didn't work either. Help would be greatly appreciated. Would it be better to just make a play button shape with raw CSS and overlay it on top of my video link? How would I go about that? I figured just having a image overlay would be the easiest way to go about it.
I have no jquery knowledge but I would hope this is possible to do without it.