I searched and searched for the solution within the community to find an answer to this “simple” problem. This message is to provide the solution to you if you are looking for the same thing - You want to add a mp4 video not a YouTube video to the home page of your theme.
After downloading and unzipping the file, change its name to: video_background.liquid.text and open it with notepad. You can then copy and paste it as directed in the video.
I hope this helps someone looking to add a mp4 (not a YouTube video) to their home page.
Works great, thank you. Any way to customize the code so the video always stays 100% width and 100% height without being cropped? Also in mobile? It’s now cropping a lot off left and right…
This did the trick for me! Thanks so much for sharing. The only thing missing is the sound that is on the video, but I reached out to Vadym for his feedback. Thanks again!!!
After uploading code and video, Video is working fine but Website shows a lot of empty space under the video and can’t even delete it or reduce it. Can you please guide?
I saw a few comments under the video and saw this solution:
“I actually was able to solve the issue. I had to change @media screen and (max-width: to 400px) vs original suggestion and it worked for me”
To fix the dead space under the banner, just comment out the video-background height in the CSS >>>> .videoBackground { /* height: 100%; */ position: relative; }
Solution for BLACK EDGE ON MOBILE : in the code that you pasted for your video-background, search for @media and change the max-width to 450px (this is the dimension of your screen when in mobile view) i then searched (ctrl+F) for ‘overflow’ and changed that from HIDDEN to ABSOLUTE… my webpage is now functioning properly on mobile and desktop view. hope this helps
Solution for BLACK SPACE: The remove the blank space beneath the video, change the style of .videoBackground { height: 100%; position: relative; } to: .videoBackground { position: relative; }