Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. Fixed Height for Html5 videos

Fixed Height for Html5 videos

Scheduled Pinned Locked Moved General Discussion
23 Posts 4 Posters 3.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • arminunruhA arminunruh

    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

    V
    V
    vj
    wrote on last edited by
    #14
    This post is deleted!
    1 Reply Last reply
    0
    • mariusjopenM
      mariusjopenM
      mariusjopen
      Global Moderator
      wrote on last edited by
      #15

      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

      www.mariusjopen.world

      1 Reply Last reply
      0
      • V
        V
        vj
        wrote on last edited by
        #16

        Thanks, it works!

        1 Reply Last reply
        0
        • CyberSlayersC
          CyberSlayersC
          CyberSlayers
          wrote on last edited by
          #17

          Nice!
          Thank you for letting us know!
          Best and have a wonderful day!

          Audrey

          ✦ Audrey@CyberSlayers.work ✦
          www.cyberslayers.work

          1 Reply Last reply
          0
          • V
            V
            vj
            wrote on last edited by
            #18
            This post is deleted!
            1 Reply Last reply
            0
            • V
              V
              vj
              wrote on last edited by
              #19

              I've achieved the desired effect by placing the video inside a carousel, but now the issue I see is that the standard video controls aren't appearing. Is there a way to make them show up?

              1 Reply Last reply
              0
              • arminunruhA
                arminunruhA
                arminunruh
                Global Moderator
                wrote on last edited by arminunruh
                #20
                <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;
                }
                
                1 Reply Last reply
                0
                • V
                  V
                  vj
                  wrote on last edited by
                  #21

                  It works! Thanks :)

                  1 Reply Last reply
                  0
                  • arminunruhA
                    arminunruhA
                    arminunruh
                    Global Moderator
                    wrote on last edited by
                    #22

                    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

                    1 Reply Last reply
                    0
                    • V
                      V
                      vj
                      wrote on last edited by
                      #23

                      Many thanks!

                      1 Reply Last reply
                      0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      Online Users
                      M
                      m.nishizawa
                      Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
                      laytheme.com
                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Search