Sunday 15 January 2017

How to Use a YouTube Video as your Webpage Background

How to Use a YouTube Video as your Webpage Background


You are presumably utilizing a still picture as the foundation for your site yet it might offer a wealthier and more great experience on the off chance that you could consider putting moving pictures, similar to an activity or an auto-playing video cut, out of sight of your website pages.

The Bing landing page much of the time utilizes video foundations, similar to those penguins bouncing out of an ice opening in a steady progression, and it takes few lines of code to implant video foundations in your website pages.

There are a few methodologies here:

Bing utilizes the standard HTML5 <video> labels to serve recordings on the landing page. The installed video has a settled size and it doesn't resize itself with the program.

There are prepared to-utilize jQuery modules, Tubular and BigVideo.js for instance, that let you effectively utilize any video, or a progression of recordings, as page foundations.

The other more straightforward approach, as should be obvious in this demo, utilizes HTML and CSS labels (no JavaScript) to help you put any YouTube video in the page foundation.

YouTube Video Backgrounds

To begin, basically glue the code underneath close to the opening <body> tag of your web format. You ought to likewise supplant the ID with the genuine video ID of the YouTube video that you might want to use out of sight.

<div style="position: settled; z-list: - 99; width: 100%; tallness: 100%">

<iframe frameborder="0" height="100%" width="100%"

src="https://youtube.com/insert/ID?autoplay=1&controls=0&showinfo=0&autohide=1">

</iframe>

</div>

/Replace ID with the real ID of your YouTube video

Inside, we are utilizing YouTube's IFRAME labels to insert that video with the end goal that it involves the whole page (both width and stature are set to 100%). Likewise, the z-record is set to negative so the YouTube video layer will seem a few levels underneath the primary substance of your page.

The drawback is that your experience video won't take a shot at cell phones and it is impractical to quiet the sound of a video without utilizing JavaScript.

Implant Background Music with YouTube Audio

Keep in mind the Geocities period when sites would consequently play ambient sounds when you opened them much to the humiliation of office laborers. They for the most part utilized crude sound documents, as MP3, WAV or even the MIDI configuration, to implant music however you can even utilize any of your most loved YouTube tracks for inserting foundation sound.

The trap is that you implant a standard YouTube video (with autoplay=1) and set the tallness and width of the video player to zero so the inserted IFRAME component remains imperceptible. This can be accomplished with a solitary line of code that you can include anyplace your website page.

1. <embed height="0" width="0"

2. src="http://youtube.googleapis.com/v/VIDEO_ID&autoplay=1&loop=1"/>You are presumably utilizing a still picture as the foundation for your site yet it might offer a wealthier and more great experience on the off chance that you could consider putting moving pictures, similar to an activity or an auto-playing video cut, out of sight of your website pages.

The Bing landing page much of the time utilizes video foundations, similar to those penguins bouncing out of an ice opening in a steady progression, and it takes few lines of code to implant video foundations in your website pages.

There are a few methodologies here:

Bing utilizes the standard HTML5 <video> labels to serve recordings on the landing page. The installed video has a settled size and it doesn't resize itself with the program.

There are prepared to-utilize jQuery modules, Tubular and BigVideo.js for instance, that let you effectively utilize any video, or a progression of recordings, as page foundations.

The other more straightforward approach, as should be obvious in this demo, utilizes HTML and CSS labels (no JavaScript) to help you put any YouTube video in the page foundation.

YouTube Video Backgrounds

To begin, basically glue the code underneath close to the opening <body> tag of your web format. You ought to likewise supplant the ID with the genuine video ID of the YouTube video that you might want to use out of sight.

<div style="position: settled; z-list: - 99; width: 100%; tallness: 100%">

<iframe frameborder="0" height="100%" width="100%"

src="https://youtube.com/insert/ID?autoplay=1&controls=0&showinfo=0&autohide=1">

</iframe>

</div>

/Replace ID with the real ID of your YouTube video

Inside, we are utilizing YouTube's IFRAME labels to insert that video with the end goal that it involves the whole page (both width and stature are set to 100%). Likewise, the z-record is set to negative so the YouTube video layer will seem a few levels underneath the primary substance of your page.

The drawback is that your experience video won't take a shot at cell phones and it is impractical to quiet the sound of a video without utilizing JavaScript.

Implant Background Music with YouTube Audio

Keep in mind the Geocities period when sites would consequently play ambient sounds when you opened them much to the humiliation of office laborers. They for the most part utilized crude sound documents, as MP3, WAV or even the MIDI configuration, to implant music however you can even utilize any of your most loved YouTube tracks for inserting foundation sound.

The trap is that you implant a standard YouTube video (with autoplay=1) and set the tallness and width of the video player to zero so the inserted IFRAME component remains imperceptible. This can be accomplished with a solitary line of code that you can include anyplace your website page.

1. <embed height="0" width="0"

2. src="http://youtube.googleapis.com/v/VIDEO_ID&autoplay=1&loop=1"/>

 

Load disqus comments

0 comments