[vc_row][vc_column width=”1/1″][vc_custom_heading text=”How to Add Background Videos in Wordpress” font_container=”tag:h2|text_align:left” google_fonts=”font_family:Josefin%20Slab%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C600%2C600italic%2C700%2C700italic|font_style:400%20regular%3A400%3Anormal”][/vc_column][/vc_row][vc_row][vc_column width=”1/1″][vc_column_text]Background videos are really helpful when it comes to enhancing the overall feel and appearance of the blog posts on a Wordpress based website. Videos are a great way to revamp your post, make it informative, and visually appealing. Integrating videos are important as they help in keeping the things live and exciting to the users. However, the process of embedding videos is a bit challenging on Wordpress websites due to many browsers, format, and theme problems, which is quite daunting even to the most seasoned developer. Although CSS has been used actively used for adding background images, but it fails to provide effective solutions when it comes for adding background videos.
We just can’t simply open the CSS put the URL of the MP4 we need to embed and set the size as per our choice to make a video run. In reality, you need to fulfill some of the following conditions to add a perfect video background on your website:
The above mentioned tasks sound a bit complicated right? And indeed they are. So, what we can do here, use custom plugin to simplify the whole process of adding video to a Wordpress post. The plugin comes complete with a self-contained shortcode which is called: bgvideo. As soon as the code is added to a post’s content, you will be provided with a functional background video. Some of the features that you’ll find in the shortcode are:
Shortcodes can be generated easily with the help of inbuilt video shortcode.
Having a background video with the post definitely makes an impact, but only when it’s not clashing with it. To eliminate anything that’s blocking the visibility of your content or video, you will have to add CSS. In most of the Wordpress site, CSS can be added simply by removing the background from the #page element. To do this, we can make use of plugin such as Simple Custom CSS and adding the following code to the child theme.
#page { background: none; }
One of the most frustrating things about iOS devices is that they have the autoplay feature disabled. Apple considers it as a bandwidth issue even if you are using Wifi, thus downloading multimedia files become quite difficult. To fix the issue, it is crucial to provide the URL of an image for the ‘poster’ attribute. This way, the user of the iOS device will view the image instead of the first frame of the video.
Additionally, you’ll also need to create “tap to play” button and use media queries to make it clearly visible on Apple devices.
A fullscreen video occupies the complete browser video and not just the entire display. A video can only be full-screened if the web page has been provided with the enough content. Sites mostly prefer to have videos enabled for full-screen mode for maximum impact.
Although, in what way you go about it is largely dependent on the type of theme you are using. To do this, you need to increase the height of the .entry-header element and make it same with .bgvideo-wrapper element. The JavaScript provided below will show you the actual process.
jQuery(document).ready(function(){ varthe_height=jQuery(‘.bgvideo-wrapper’).height(); jQuery(‘header.entry-header’).height(the_height); }); jQuery(window).resize(function(){ varthe_height=jQuery(‘.bgvideo-wrapper’).height(); jQuery(‘header.entry-header’).height(the_height); });
While working in Chrome, you’ll notice a scrollbar when the z-index is set on
.bgvideo-wrapper div. This is not the case with Firefox and Safari. To sort the issue, you need to alter the attribute ‘overflow’ of the HTML element, to ‘hidden’, before resizing the various elements that work together in the background video. After this, set the attribute from ‘overflow’ to ‘auto’.
It’s a true saying that nothing tells a story in quite the way a video does, and when it is blended with the powers of the web, it creates an environment that’s fascinating and interactive for the user. Therefore, implement the above mentioned and increase their engagement[/vc_column_text][/vc_column][/vc_row]