HTML5 Video Background

While Video Backgrounds are a very desirable technique in web design today, there are several limitations to consider before implementing this. Keep in mind that:

  • 1.) Fullscreen videos with clickable HTML elements overlaying will not work on iPad.
  • 2.) iPhone and Android browser will break the video out into it’s own player, completely destroying this setup. This is not something you should plan to serve to mobile browsers.
  • 3.) Autoplay is also disabled on iOS devices, again solidifying that this type of design is not suited for the current mobile browsing environment.

I have been on an epic quest to learn all about HTML5 video and its current capabilities, now I am sharing some of the valuable info I’ve obtained through experience. I will show you the best and most hassle free ways to create an HTML Fullscreen Video Background.

The Standard Method is me coding by hand, and in the jQuery Method I will show you how to implement a function which alleviates some of the hedge cases not covered by the Standard Method. It never hurts to build on the work of others!

Standard Method

My first try at HTML5 video background was done using the simple video tag we explored here. This along with some CSS classes will achieve most of the effect we’re going for. However there are some hedge cases that this simple method does not account for. It looks fine on first load, but if the user resizes the browser to less than the video’s aspect ratio, we will get a white space at the bottom of the screen. If your HTML content is shorter in height than your video, this method is fine.

HTML5 Video Embed

Notice we only specify the width, not the height of the video. If you specify the height as well, the video will shrink down to fit on the screen, creating whitespace. This is supposed to be a background so we want full window coverage at all times, even if it means not seeing all of the video.

            

CSS Classes

Here we use CSS to make the video’s container always be the size of the browser window, and make sure that it stays in its spot when scrolling through the HTML content, and a negative z-index value to keep it below our HTML content.

            body{
                margin: 0 0 0 0;
                padding: 0 0 0 0;
            }

            #container{
                position: fixed;
                height: 100%; 
                width: 100%; 
                top: 0; 
                left: 0;
                z-index: -1;	
            }
            

jQuery Method

This Method is to show you how much you can improve your own products by building on the work of others. I have gone through every example of this type I could find, and jQuery VideoBG plugin is the most hassle free script I’ve come across to date. All you need to do is upload the .js file to your server and link it in your page’s header, along with jQuery, and add the videoBG jQuery call to your Ready function. This eliminates the need for a video container div, and the HTML5 video tag; videoBG generates it for you. The main reason I like this script is that it gets rid of that pesky whitespace when users resize their browsers. Depending on how much HTML content you are overlaying over your video background, this method may or may not be an improvement for you.

            
            
            
            
            
            

There are several other “pre-packaged” solutions for Video Backgrounds such as CMS Themes and other javascript libraries, not many of which are free. In this demo, I wanted to show how bare-bones we could go with it. In the next post I will explain how adding higher levels of interactivity to video usually requires a third-party video player and learning to program Javascript using an API reference.

-Zack Smith
Interactive Developer at Graphite Lab

BOARD SPORTS is here!

Play Golf, Pool, and Bowling like never before in this three-game sports series only possible on Board. Here's why I love it: 

The "phygital" pieces offer new ways to interact. Twist, Swing and Slide to make the perfect golf shot, roll the perfect strike, or land the sweetest bank shot to sink the 8-ball. It just feels more fun on Board. 

It's made for friends and family, but is a blast playing solo as well. Different game modes, rules, and settings allow each game to suit all sorts of skill levels. 

It captures the "one more round" magic that brings me right back to the first time I loaded Wii Sports. 

We hope you love it, too!

Check out the game: 
https://board.fun/products/board-sports

Learn more about BOARD: 
https://board.fun/products/the-board

#boardisfun #stlmade #graphitelab #golf #bowling #billiards #madewithunity
New from Graphite Lab and Atari – its Centipede Swarm!
Centipede: Swarm fuses the arcade purity of Centipede with chaotic, power-scaling mayhem — evolving Atari’s classic for Amazon Luna Family Game Night! Play this four-player neon-drenched, bullet-hell roguelike Free with Prime on Amazon Luna.

Game: https://luna.amazon.com/game/centipede-swarm/B0FP79K7WS
Time is running out!

Hive Jump 2: Survivors is part of Steam Bullet Fest and is currently 50% OFF!

Blast through endless alien hordes and grab the deal before Bullet Fest ends on June 15 at 10 AM PST.

Hive Jump 2: Survivors:
https://store.steampowered.com/app/2545740/Hive_Jump_2_Survivors/ (https://store.steampowered.com/app/2545740/Hive_Jump_2_Survivors/)

See a
ll Bullet Fest games:

https://store.steampowered.com/category/bullet (https://store.steampowered.com/category/bullet)
#hivejump #game #50%off #deals
Rollercoaster Tycoon Classic is out for PS4, XBOX One, and Nintendo Switch 2! Grab your JoyCons and start building the park of your dreams! Now with mouse support controls and in 4k resolution. 

#rollercoasters #tycoon #nintendo #xbox #ps4
Must Play Bullet-Heaven games

Available now on Google Play!

#brotato #hivejump #vampiresurvivors #deathmustdie #20minutestilldawn
Fresh trailer! Hive Jump 2: Survivors, free to download on Google Play! As the lone survivor of a jump squad, you must mow down hordes, destroy hives, and use resources like alien goo and amber to unlock permanent upgrades.

Google Play: https://play.google.com/store/apps/details?id=com.graphitelab.hivejumpsurvivors
#indiegames #graphitelab #hivejump #games #popular
Hive Jump 2 is now officially on Google Play! Featured in Google’s Indie Selects, Hive Jump 2 is a sci-fi bullet heaven roguelite where players fight endless alien swarms using a jetpack to dodge and attack, collect resources to upgrade abilities and weapons in a quest for vengeance!

App Link: https://play.google.com/store/apps/details?id=com.graphitelab.hivejumpsurvivors&hl=en_US

#hivejump #hivejump2survivors #indiegames #googleplay #android
Happy to report RollerCoaster Tycoon Classic is available now on on Xbox Series and PlayStation 5! 

Packed with content -- including 95 scenarios -- players can enjoy designing and building outrageous roller coasters and rides, landscaping parks and managing the staff and finances to keep their guests happy and the money flowing in. 

#rct #rollercoastertycoon #graphitelab #stlmade #xbox #playstation #ps5 #retrogames
So many Graphite Lab games are on sale! Visit https://store.steampowered.com and get amazing games for less! 

qomp2
Mr. Run and Jump
Kombinera
Hive Jump
Hive Jump 2: Survivors 
RollerCoaster Tycoon Classic 

and more!

#gamedeals #indiegames #steamsale #wintersale #stlmade #holidaydeals #videogames #steamgames
Have you checked out Board.fun yet?! 

@polygondotcom did a deep dive on the brand new console which features a launch title from your friends at Graphite Lab! 

Check it out! Chop Chop!

https://www.polygon.com/board-game-console-review/

#gamedev #polygon #STLMade #graphitelab #cooking #2d #holidayshopping
Loading the next set of instagram posts...