Fixed Height for Html5 videos
-
@mariusjopen hello Marius! Is there something I can do to fix this problem? I eventually want to have photos and videos in a carousel, so I think that @arminunruh answer won't be the solution :( Many thanks
-
Dear @vj
we will have another look!
Best!
Marius -
I mean in the end its about applying CSS in the right way for your case
@mariusjopen can you try and see which CSS he used and see if you can improve his CSS
-
anyway, i added this to my list, would be great to be able to make elements have a certain fixed height one day. however, this is kind of low priority right now
if you'd like us to take another look at your css, please create a new page, insert a html5 video and use a html class on it that has your css applied and post the link please <3
-
This post is deleted!
-
Dear @vj
have a look here:
.html5video .html5-video-placeholder-image.w100 img { width: 100%; height: auto; position: absolute; left: 0; top: 50%; -webkit-transform: translateY(-50%); -ms-transform: translateY(-50%); transform: translateY(-50%); height: 100vh; object-fit: cover; } .html5video .ph { position: relative; padding-bottom: 100vh !important; }
Best!
Marius
-
Nice!
Thank you for letting us know!
Best and have a wonderful day!Audrey
-
<script> window.laytheme.on('newpageshown', function(){ jQuery('.lay-carousel-wrap video').each(function(){ jQuery(this).attr('controls', 'true'); }) }) </script>
if you put that in <head> content in lay options -> custom html & css
does that work?or instead of using that script, maybe use a normal html5 video element and this css?:
.html5video .ph { position: relative; padding-bottom: calc(101vh - 74px)!important; }
-
when i was on your website i saw a cool thing about putting your video in a carousel
on any aspect ratio / screen dimensions, the full video will always show as it will always be contained in the browser width and height
if you use the html5 video solution i think this wont be the case
maybe you can add:
.html5video video { width: 100%!important; height: 100%!important; object-fit: contain!important; }
then maybe it will work like this too if you use a html5 video element instead of only a carousel
and for the carousel i noticed that the unmute button loses its position when you resize the window. if you update the carousel addon now, this should be fixed
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it