html - Clip-path not working on videos -
i have been trying display image , on hover, video start replacing image, used javascript hover functions.
i did using "poster" in video tag this:`
<div class="video"> <video id="videotest" poster="images/img.jpg"> <source src="images/bkg.mp4" type="video/mp4"></source> can't use videos here. </video> </div>
however, video same size image. video 1280*720, , image 677-611. tried use clip-path adapt video doesn't work, here css:
.video { text-align:center; margin:0 auto; height:auto; clip-path:inset(0 978px 611px 301px); -webkit-clip-path:inset(0 978px 611px 301px); }
i tried applying style .video, #videotest , source, still didn't work expected.
is impossible use clip-path videos in html5? if so, how can it, , if not, how can make work?
i explain myself little more: don't want image resize, keeping proportions or not, cut off, example, pixels left , right, image in poster same size video replacing it. clip-path seemed correspond looking for, can't work.
thanks.
well here code in html add in video tag poster="transparent.jpg" call css background , preload="none" make poster visible make sure add video's extension works browsers in source tag inside video tag unfortunately couldn't finger out extension works safari, works if add video 1 extension source folder never try
.video { background:transparent url('http://dev.powered-by-haiku.co.uk/jw-html-config/posters/big-buck-bunny-preview.jpg') no-repeat; background-size: 677px 611px; text-align:center; margin: 0 auto; width: 677px; height:611px; } video { width: 677px; height:611px; object-fit:inherit; }
<div class="video"> <video controls="true" id="videotest" poster="transparent.jpg" preload="none"> <source src="http://clips.vorwaerts-gmbh.de/vfe_html5.mp4" type="video/mp4"/> <source src="http://clips.vorwaerts-gmbh.de/vfe.webm" type="video/webm" /> <source src="http://clips.vorwaerts-gmbh.de/vfe.ogv" type="video/ogg" /> </video> </div>
Comments
Post a Comment