Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • 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. Use a video as page background

Use a video as page background

Scheduled Pinned Locked Moved General Discussion
videobackgroundvideobackground
12 Posts 5 Posters 2.2k Views
  • 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 Offline
    arminunruhA Offline
    arminunruh
    Global Moderator
    wrote on last edited by
    #2

    hey do you have a link to your website where the row video background doesn't work?

    1 Reply Last reply
    0
    • N Offline
      N Offline
      Nunomaio
      wrote on last edited by
      #3

      hey, yes.

      http://www.nuno-maio.com/matou so this how its looking like, but i want it like this : http://www.nuno-maio.com/matou2 and then the images scrolling over it.

      thanks you!

      1 Reply Last reply
      0
      • N Offline
        N Offline
        Nunomaio
        wrote on last edited by
        #4

        Hey Armin, could u see it?

        thanks

        best,

        Nuno

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

          Hey I'm sorry that I didn't look at this earlier.

          Ok so since lay theme can't do this at the moment we can do it by ourselves with custom code :).

          In "Lay Options" -> "Custom CSS & HTML" -> "Custom <head> content" please enter:

          <style>
          .fixed-bg-video {
              position: fixed;
              width: 100%;
              height: 100vh;
              object-fit: cover;
              top: 0;
              left: 0;
              z-index: -1;
          }
          </style>
          

          Now in "Custom HTML at bottom" enter:

          <video class="fixed-bg-video" preload="" muted="" autoplay="" loop="">
              <source src="http://www.nuno-maio.com/wp-content/uploads/2016/10/IMG_6733.m4v" type="video/mp4">
          </video>
          

          Maybe for mobile you want to hide the video.
          In "Custom CSS for Mobile Version" do:

          .fixed-bg-video{
          display: none;
          }
          
          N J 2 Replies Last reply
          0
          • arminunruhA arminunruh

            Hey I'm sorry that I didn't look at this earlier.

            Ok so since lay theme can't do this at the moment we can do it by ourselves with custom code :).

            In "Lay Options" -> "Custom CSS & HTML" -> "Custom <head> content" please enter:

            <style>
            .fixed-bg-video {
                position: fixed;
                width: 100%;
                height: 100vh;
                object-fit: cover;
                top: 0;
                left: 0;
                z-index: -1;
            }
            </style>
            

            Now in "Custom HTML at bottom" enter:

            <video class="fixed-bg-video" preload="" muted="" autoplay="" loop="">
                <source src="http://www.nuno-maio.com/wp-content/uploads/2016/10/IMG_6733.m4v" type="video/mp4">
            </video>
            

            Maybe for mobile you want to hide the video.
            In "Custom CSS for Mobile Version" do:

            .fixed-bg-video{
            display: none;
            }
            
            N Offline
            N Offline
            Nunomaio
            wrote on last edited by
            #6

            @arminunruh HEY!! it worked, thank you so much!!!

            http://www.nuno-maio.com/matou

            one more thing please, i only want this to happen on this page, now the video is in every page how do i make just for this one?

            thank you so much!!!!! :D

            Nuno

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

              Cool! Cool art!
              You can do it like this in "Lay Options" -> "Custom CSS & HTML" -> "Custom CSS for Desktop Version"

              body.slug-matou .fixed-bg-video{
              display: block;
              }
              .fixed-bg-video{
              display:none;
              }
              

              I'm using css that is only for that "matou" page. Here I wrote about how to apply css only to a specific page in lay theme http://laytheme.com/documentation.html#css-based-on-current-page

              N 1 Reply Last reply
              0
              • arminunruhA arminunruh

                Cool! Cool art!
                You can do it like this in "Lay Options" -> "Custom CSS & HTML" -> "Custom CSS for Desktop Version"

                body.slug-matou .fixed-bg-video{
                display: block;
                }
                .fixed-bg-video{
                display:none;
                }
                

                I'm using css that is only for that "matou" page. Here I wrote about how to apply css only to a specific page in lay theme http://laytheme.com/documentation.html#css-based-on-current-page

                N Offline
                N Offline
                Nunomaio
                wrote on last edited by
                #8

                @arminunruh said:

                http://laytheme.com/documentation.html#css-based-on-current-page

                Thank you man!

                And thank you for your help :D

                1 Reply Last reply
                0
                • countachC Offline
                  countachC Offline
                  countach
                  wrote on last edited by
                  #9

                  Hey @arminunruh

                  On this website : www.dominique-sierra.fr, I tried the custom code you gave earlier to show a video as background.

                  In custom CSS & HTML :

                  <style>
                  .fixed-bg-video {
                  position: fixed;
                  width: 100%;
                  height: 100vh;
                  object-fit: cover;
                  top: 0;
                  left: 0;
                  z-index: -1;
                  }
                  </style>

                  And in custom HTML at bottom

                  <video class="fixed-bg-video" preload="" muted="" autoplay="" loop="">
                  <source src="http://www.nuno-maio.com/wp-content/uploads/2016/10/IMG_6733.m4v" type="video/mp4">
                  </video>

                  The video doesn’t work on mobile version, there is just an image of the video.
                  Is there a way to make this work on mobile?

                  Thx dude, laytheme is gold

                  1 Reply Last reply
                  0
                  • mariusjopenM Offline
                    mariusjopenM Offline
                    mariusjopen
                    Global Moderator
                    wrote on last edited by
                    #10

                    Hi @countach

                    videos are not possible to display like that on mobile-phones yet.

                    Have a look here.
                    Thats a website I programmed some time ago which looks very similar.
                    http://belius.de/

                    Here I use jQuery to move images around. You can copy that code if you like.
                    All the best!

                    Marius

                    www.mariusjopen.world

                    1 Reply Last reply
                    0
                    • countachC Offline
                      countachC Offline
                      countach
                      wrote on last edited by
                      #11

                      Ok thanks a lot @mariusjopen for having a look, I'll try to use this code;)

                      1 Reply Last reply
                      1
                      • arminunruhA arminunruh

                        Hey I'm sorry that I didn't look at this earlier.

                        Ok so since lay theme can't do this at the moment we can do it by ourselves with custom code :).

                        In "Lay Options" -> "Custom CSS & HTML" -> "Custom <head> content" please enter:

                        <style>
                        .fixed-bg-video {
                            position: fixed;
                            width: 100%;
                            height: 100vh;
                            object-fit: cover;
                            top: 0;
                            left: 0;
                            z-index: -1;
                        }
                        </style>
                        

                        Now in "Custom HTML at bottom" enter:

                        <video class="fixed-bg-video" preload="" muted="" autoplay="" loop="">
                            <source src="http://www.nuno-maio.com/wp-content/uploads/2016/10/IMG_6733.m4v" type="video/mp4">
                        </video>
                        

                        Maybe for mobile you want to hide the video.
                        In "Custom CSS for Mobile Version" do:

                        .fixed-bg-video{
                        display: none;
                        }
                        
                        J Offline
                        J Offline
                        jhc
                        wrote on last edited by
                        #12
                        This post is deleted!
                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        I also code custom websites or custom Lay features.
                        💿 Email me here: 💿
                        info@laytheme.com

                        Before you post:
                        1. When using a WordPress Cache plugin, disable it or clear your cache.
                        2. Update Lay Theme and all Lay Theme Addons
                        3. Disable all Plugins
                        4. 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:
                        1. Post a link to where the problem is
                        2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
                        3. If the problem is difficult to explain, post screenshots / link to a video to explain it
                        Online Users
                        A
                        alasdair17
                        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